create project
This commit is contained in:
11
kitabcitab/node_modules/next/dist/server/lib/etag.d.ts
generated
vendored
Normal file
11
kitabcitab/node_modules/next/dist/server/lib/etag.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* FNV-1a Hash implementation
|
||||
* @author Travis Webb (tjwebb) <me@traviswebb.com>
|
||||
*
|
||||
* Ported from https://github.com/tjwebb/fnv-plus/blob/master/index.js
|
||||
*
|
||||
* Simplified, optimized and add modified for 52 bit, which provides a larger hash space
|
||||
* and still making use of Javascript's 53-bit integer space.
|
||||
*/
|
||||
export declare const fnv1a52: (str: string) => number;
|
||||
export declare const generateETag: (payload: string, weak?: boolean) => string;
|
||||
33
kitabcitab/node_modules/next/dist/server/lib/etag.js
generated
vendored
Normal file
33
kitabcitab/node_modules/next/dist/server/lib/etag.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.generateETag = exports.fnv1a52 = void 0;
|
||||
const fnv1a52 = (str)=>{
|
||||
const len = str.length;
|
||||
let i = 0, t0 = 0, v0 = 0x2325, t1 = 0, v1 = 0x8422, t2 = 0, v2 = 0x9ce4, t3 = 0, v3 = 0xcbf2;
|
||||
while(i < len){
|
||||
v0 ^= str.charCodeAt(i++);
|
||||
t0 = v0 * 435;
|
||||
t1 = v1 * 435;
|
||||
t2 = v2 * 435;
|
||||
t3 = v3 * 435;
|
||||
t2 += v0 << 8;
|
||||
t3 += v1 << 8;
|
||||
t1 += t0 >>> 16;
|
||||
v0 = t0 & 65535;
|
||||
t2 += t1 >>> 16;
|
||||
v1 = t1 & 65535;
|
||||
v3 = t3 + (t2 >>> 16) & 65535;
|
||||
v2 = t2 & 65535;
|
||||
}
|
||||
return (v3 & 15) * 281474976710656 + v2 * 4294967296 + v1 * 65536 + (v0 ^ v3 >> 4);
|
||||
};
|
||||
exports.fnv1a52 = fnv1a52;
|
||||
const generateETag = (payload, weak = false)=>{
|
||||
const prefix = weak ? 'W/"' : '"';
|
||||
return prefix + fnv1a52(payload).toString(36) + payload.length.toString(36) + '"';
|
||||
};
|
||||
exports.generateETag = generateETag;
|
||||
|
||||
//# sourceMappingURL=etag.js.map
|
||||
1
kitabcitab/node_modules/next/dist/server/lib/etag.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/lib/etag.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../server/lib/etag.ts"],"names":["fnv1a52","str","len","length","i","t0","v0","t1","v1","t2","v2","t3","v3","charCodeAt","generateETag","payload","weak","prefix","toString"],"mappings":"AASA;;;;;AAAO,MAAMA,OAAO,GAAG,CAACC,GAAW,GAAK;IACtC,MAAMC,GAAG,GAAGD,GAAG,CAACE,MAAM;IACtB,IAAIC,CAAC,GAAG,CAAC,EACPC,EAAE,GAAG,CAAC,EACNC,EAAE,GAAG,MAAM,EACXC,EAAE,GAAG,CAAC,EACNC,EAAE,GAAG,MAAM,EACXC,EAAE,GAAG,CAAC,EACNC,EAAE,GAAG,MAAM,EACXC,EAAE,GAAG,CAAC,EACNC,EAAE,GAAG,MAAM;IAEb,MAAOR,CAAC,GAAGF,GAAG,CAAE;QACdI,EAAE,IAAIL,GAAG,CAACY,UAAU,CAACT,CAAC,EAAE,CAAC;QACzBC,EAAE,GAAGC,EAAE,GAAG,GAAG;QACbC,EAAE,GAAGC,EAAE,GAAG,GAAG;QACbC,EAAE,GAAGC,EAAE,GAAG,GAAG;QACbC,EAAE,GAAGC,EAAE,GAAG,GAAG;QACbH,EAAE,IAAIH,EAAE,IAAI,CAAC;QACbK,EAAE,IAAIH,EAAE,IAAI,CAAC;QACbD,EAAE,IAAIF,EAAE,KAAK,EAAE;QACfC,EAAE,GAAGD,EAAE,GAAG,KAAK;QACfI,EAAE,IAAIF,EAAE,KAAK,EAAE;QACfC,EAAE,GAAGD,EAAE,GAAG,KAAK;QACfK,EAAE,GAAG,AAACD,EAAE,GAAG,CAACF,EAAE,KAAK,EAAE,CAAC,GAAI,KAAK;QAC/BC,EAAE,GAAGD,EAAE,GAAG,KAAK;KAChB;IAED,OACE,CAACG,EAAE,GAAG,EAAE,CAAC,GAAG,eAAe,GAC3BF,EAAE,GAAG,UAAU,GACfF,EAAE,GAAG,KAAK,GACV,CAACF,EAAE,GAAIM,EAAE,IAAI,CAAC,AAAC,CAAC,CACjB;CACF;QAlCYZ,OAAO,GAAPA,OAAO;AAoCb,MAAMc,YAAY,GAAG,CAACC,OAAe,EAAEC,IAAI,GAAG,KAAK,GAAK;IAC7D,MAAMC,MAAM,GAAGD,IAAI,GAAG,KAAK,GAAG,GAAG;IACjC,OACEC,MAAM,GAAGjB,OAAO,CAACe,OAAO,CAAC,CAACG,QAAQ,CAAC,EAAE,CAAC,GAAGH,OAAO,CAACZ,MAAM,CAACe,QAAQ,CAAC,EAAE,CAAC,GAAG,GAAG,CAC3E;CACF;QALYJ,YAAY,GAAZA,YAAY"}
|
||||
11
kitabcitab/node_modules/next/dist/server/lib/find-page-file.d.ts
generated
vendored
Normal file
11
kitabcitab/node_modules/next/dist/server/lib/find-page-file.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Finds a page file with the given parameters. If the page is duplicated with
|
||||
* multiple extensions it will throw, otherwise it will return the *relative*
|
||||
* path to the page file or null if it is not found.
|
||||
*
|
||||
* @param pagesDir Absolute path to the pages folder with trailing `/pages`.
|
||||
* @param normalizedPagePath The page normalized (it will be denormalized).
|
||||
* @param pageExtensions Array of page extensions.
|
||||
*/
|
||||
export declare function findPageFile(pagesDir: string, normalizedPagePath: string, pageExtensions: string[], isAppDir: boolean): Promise<string | null>;
|
||||
export declare function isLayoutsLeafPage(filePath: string, pageExtensions: string[]): boolean;
|
||||
49
kitabcitab/node_modules/next/dist/server/lib/find-page-file.js
generated
vendored
Normal file
49
kitabcitab/node_modules/next/dist/server/lib/find-page-file.js
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.findPageFile = findPageFile;
|
||||
exports.isLayoutsLeafPage = isLayoutsLeafPage;
|
||||
var _fileExists = require("../../lib/file-exists");
|
||||
var _getPagePaths = require("../../shared/lib/page-path/get-page-paths");
|
||||
var _nonNullable = require("../../lib/non-nullable");
|
||||
var _path = require("path");
|
||||
var _fs = require("fs");
|
||||
var _log = require("../../build/output/log");
|
||||
var _chalk = _interopRequireDefault(require("../../lib/chalk"));
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
async function isTrueCasePagePath(pagePath, pagesDir) {
|
||||
const pageSegments = (0, _path).normalize(pagePath).split(_path.sep).filter(Boolean);
|
||||
const segmentExistsPromises = pageSegments.map(async (segment, i)=>{
|
||||
const segmentParentDir = (0, _path).join(pagesDir, ...pageSegments.slice(0, i));
|
||||
const parentDirEntries = await _fs.promises.readdir(segmentParentDir);
|
||||
return parentDirEntries.includes(segment);
|
||||
});
|
||||
return (await Promise.all(segmentExistsPromises)).every(Boolean);
|
||||
}
|
||||
async function findPageFile(pagesDir, normalizedPagePath, pageExtensions, isAppDir) {
|
||||
const pagePaths = (0, _getPagePaths).getPagePaths(normalizedPagePath, pageExtensions, isAppDir);
|
||||
const [existingPath, ...others] = (await Promise.all(pagePaths.map(async (path)=>{
|
||||
const filePath = (0, _path).join(pagesDir, path);
|
||||
return await (0, _fileExists).fileExists(filePath) ? path : null;
|
||||
}))).filter(_nonNullable.nonNullable);
|
||||
if (!existingPath) {
|
||||
return null;
|
||||
}
|
||||
if (!await isTrueCasePagePath(existingPath, pagesDir)) {
|
||||
return null;
|
||||
}
|
||||
if (others.length > 0) {
|
||||
(0, _log).warn(`Duplicate page detected. ${_chalk.default.cyan((0, _path).join("pages", existingPath))} and ${_chalk.default.cyan((0, _path).join("pages", others[0]))} both resolve to ${_chalk.default.cyan(normalizedPagePath)}.`);
|
||||
}
|
||||
return existingPath;
|
||||
}
|
||||
function isLayoutsLeafPage(filePath, pageExtensions) {
|
||||
return new RegExp(`(^page|[\\\\/]page)\\.(?:${pageExtensions.join("|")})$`).test(filePath);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=find-page-file.js.map
|
||||
1
kitabcitab/node_modules/next/dist/server/lib/find-page-file.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/lib/find-page-file.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../server/lib/find-page-file.ts"],"names":["findPageFile","isLayoutsLeafPage","isTrueCasePagePath","pagePath","pagesDir","pageSegments","normalize","split","sep","filter","Boolean","segmentExistsPromises","map","segment","i","segmentParentDir","join","slice","parentDirEntries","promises","readdir","includes","Promise","all","every","normalizedPagePath","pageExtensions","isAppDir","pagePaths","getPagePaths","existingPath","others","path","filePath","fileExists","nonNullable","length","warn","chalk","cyan","RegExp","test"],"mappings":"AAAA;;;;QA4BsBA,YAAY,GAAZA,YAAY;QAuClBC,iBAAiB,GAAjBA,iBAAiB;AAnEN,IAAA,WAAuB,WAAvB,uBAAuB,CAAA;AACrB,IAAA,aAA2C,WAA3C,2CAA2C,CAAA;AAC5C,IAAA,YAAwB,WAAxB,wBAAwB,CAAA;AACf,IAAA,KAAM,WAAN,MAAM,CAAA;AAClB,IAAA,GAAI,WAAJ,IAAI,CAAA;AACR,IAAA,IAAwB,WAAxB,wBAAwB,CAAA;AAC3B,IAAA,MAAiB,kCAAjB,iBAAiB,EAAA;;;;;;AAEnC,eAAeC,kBAAkB,CAACC,QAAgB,EAAEC,QAAgB,EAAE;IACpE,MAAMC,YAAY,GAAGC,CAAAA,GAAAA,KAAS,AAAU,CAAA,UAAV,CAACH,QAAQ,CAAC,CAACI,KAAK,CAACC,KAAG,IAAA,CAAC,CAACC,MAAM,CAACC,OAAO,CAAC;IACnE,MAAMC,qBAAqB,GAAGN,YAAY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,OAAO,IAAI,CAAA;KACZ;IAED,IAAI2B,MAAM,CAACK,MAAM,GAAG,CAAC,EAAE;QACrBC,CAAAA,GAAAA,IAAI,AAMH,CAAA,KANG,CACF,CAAC,yBAAyB,EAAEC,MAAK,QAAA,CAACC,IAAI,CACpCvB,CAAAA,GAAAA,KAAI,AAAuB,CAAA,KAAvB,CAAC,OAAO,EAAEc,YAAY,CAAC,CAC5B,CAAC,KAAK,EAAEQ,MAAK,QAAA,CAACC,IAAI,CACjBvB,CAAAA,GAAAA,KAAI,AAAoB,CAAA,KAApB,CAAC,OAAO,EAAEe,MAAM,CAAC,CAAC,CAAC,CAAC,CACzB,CAAC,iBAAiB,EAAEO,MAAK,QAAA,CAACC,IAAI,CAACd,kBAAkB,CAAC,CAAC,CAAC,CAAC,CACvD;KACF;IAED,OAAOK,YAAY,CAAA;CACpB;AAIM,SAAS7B,iBAAiB,CAACgC,QAAgB,EAAEP,cAAwB,EAAE;IAC5E,OAAO,IAAIc,MAAM,CACf,CAAC,yBAAyB,EAAEd,cAAc,CAACV,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CACzD,CAACyB,IAAI,CAACR,QAAQ,CAAC,CAAA;CACjB"}
|
||||
9
kitabcitab/node_modules/next/dist/server/lib/incremental-cache/fetch-cache.d.ts
generated
vendored
Normal file
9
kitabcitab/node_modules/next/dist/server/lib/incremental-cache/fetch-cache.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { CacheHandler, CacheHandlerContext, CacheHandlerValue } from './';
|
||||
export default class FetchCache implements CacheHandler {
|
||||
private headers;
|
||||
private cacheEndpoint;
|
||||
private debug;
|
||||
constructor(ctx: CacheHandlerContext);
|
||||
get(key: string, fetchCache?: boolean): Promise<CacheHandlerValue | null>;
|
||||
set(key: string, data: CacheHandlerValue['value'], fetchCache?: boolean): Promise<void>;
|
||||
}
|
||||
134
kitabcitab/node_modules/next/dist/server/lib/incremental-cache/fetch-cache.js
generated
vendored
Normal file
134
kitabcitab/node_modules/next/dist/server/lib/incremental-cache/fetch-cache.js
generated
vendored
Normal file
@@ -0,0 +1,134 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _lruCache = _interopRequireDefault(require("next/dist/compiled/lru-cache"));
|
||||
var _appRouterHeaders = require("../../../client/components/app-router-headers");
|
||||
class FetchCache {
|
||||
constructor(ctx){
|
||||
if (ctx.maxMemoryCacheSize && !memoryCache) {
|
||||
memoryCache = new _lruCache.default({
|
||||
max: ctx.maxMemoryCacheSize,
|
||||
length ({ value }) {
|
||||
var ref;
|
||||
if (!value) {
|
||||
return 25;
|
||||
} else if (value.kind === "REDIRECT") {
|
||||
return JSON.stringify(value.props).length;
|
||||
} else if (value.kind === "IMAGE") {
|
||||
throw new Error("invariant image should not be incremental-cache");
|
||||
} else if (value.kind === "FETCH") {
|
||||
return JSON.stringify(value.data || "").length;
|
||||
}
|
||||
// rough estimate of size of cache value
|
||||
return value.html.length + (((ref = JSON.stringify(value.pageData)) == null ? void 0 : ref.length) || 0);
|
||||
}
|
||||
});
|
||||
}
|
||||
this.debug = !!process.env.NEXT_PRIVATE_DEBUG_CACHE;
|
||||
this.headers = {};
|
||||
this.headers["Content-Type"] = "application/json";
|
||||
if (_appRouterHeaders.FETCH_CACHE_HEADER in ctx._requestHeaders) {
|
||||
const newHeaders = JSON.parse(ctx._requestHeaders[_appRouterHeaders.FETCH_CACHE_HEADER]);
|
||||
for(const k in newHeaders){
|
||||
this.headers[k] = newHeaders[k];
|
||||
}
|
||||
}
|
||||
this.cacheEndpoint = `https://${ctx._requestHeaders["x-vercel-sc-host"]}${ctx._requestHeaders["x-vercel-sc-basepath"] || ""}`;
|
||||
if (this.debug) {
|
||||
console.log("using cache endpoint", this.cacheEndpoint);
|
||||
}
|
||||
}
|
||||
async get(key, fetchCache) {
|
||||
if (!fetchCache) return null;
|
||||
let data = memoryCache == null ? void 0 : memoryCache.get(key);
|
||||
// get data from fetch cache
|
||||
if (!data) {
|
||||
try {
|
||||
const start = Date.now();
|
||||
const res = await fetch(`${this.cacheEndpoint}/v1/suspense-cache/getItems`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify([
|
||||
key
|
||||
]),
|
||||
headers: this.headers
|
||||
});
|
||||
if (!res.ok) {
|
||||
console.error(await res.text());
|
||||
throw new Error(`invalid response from cache ${res.status}`);
|
||||
}
|
||||
const items = await res.json();
|
||||
const item = items[key];
|
||||
if (!item || !item.value) {
|
||||
console.log({
|
||||
item
|
||||
});
|
||||
throw new Error(`invalid item returned`);
|
||||
}
|
||||
const cached = JSON.parse(item.value);
|
||||
if (!cached || cached.kind !== "FETCH") {
|
||||
this.debug && console.log({
|
||||
cached
|
||||
});
|
||||
throw new Error(`invalid cache value`);
|
||||
}
|
||||
data = {
|
||||
lastModified: Date.now() - item.age * 1000,
|
||||
value: cached
|
||||
};
|
||||
if (this.debug) {
|
||||
console.log("got fetch cache entry duration:", Date.now() - start, data);
|
||||
}
|
||||
if (data) {
|
||||
memoryCache == null ? void 0 : memoryCache.set(key, data);
|
||||
}
|
||||
} catch (err) {
|
||||
// unable to get data from fetch-cache
|
||||
console.error(`Failed to get from fetch-cache`, err);
|
||||
}
|
||||
}
|
||||
return data || null;
|
||||
}
|
||||
async set(key, data, fetchCache) {
|
||||
if (!fetchCache) return;
|
||||
memoryCache == null ? void 0 : memoryCache.set(key, {
|
||||
value: data,
|
||||
lastModified: Date.now()
|
||||
});
|
||||
try {
|
||||
const start = Date.now();
|
||||
const body = JSON.stringify([
|
||||
{
|
||||
id: key,
|
||||
value: JSON.stringify(data)
|
||||
},
|
||||
]);
|
||||
const res = await fetch(`${this.cacheEndpoint}/v1/suspense-cache/setItems`, {
|
||||
method: "POST",
|
||||
headers: this.headers,
|
||||
body: body
|
||||
});
|
||||
if (!res.ok) {
|
||||
this.debug && console.log(await res.text());
|
||||
throw new Error(`invalid response ${res.status}`);
|
||||
}
|
||||
if (this.debug) {
|
||||
console.log("successfully set to fetch-cache duration:", Date.now() - start, body);
|
||||
}
|
||||
} catch (err) {
|
||||
// unable to set to fetch-cache
|
||||
console.error(`Failed to update fetch cache`, err);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
exports.default = FetchCache;
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
let memoryCache;
|
||||
|
||||
//# sourceMappingURL=fetch-cache.js.map
|
||||
1
kitabcitab/node_modules/next/dist/server/lib/incremental-cache/fetch-cache.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/lib/incremental-cache/fetch-cache.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
11
kitabcitab/node_modules/next/dist/server/lib/incremental-cache/file-system-cache.d.ts
generated
vendored
Normal file
11
kitabcitab/node_modules/next/dist/server/lib/incremental-cache/file-system-cache.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { CacheHandler, CacheHandlerContext, CacheHandlerValue } from './';
|
||||
export default class FileSystemCache implements CacheHandler {
|
||||
private fs;
|
||||
private flushToDisk?;
|
||||
private serverDistDir;
|
||||
private appDir;
|
||||
constructor(ctx: CacheHandlerContext);
|
||||
get(key: string, fetchCache?: boolean): Promise<CacheHandlerValue | null>;
|
||||
set(key: string, data: CacheHandlerValue['value']): Promise<void>;
|
||||
private getFsPath;
|
||||
}
|
||||
141
kitabcitab/node_modules/next/dist/server/lib/incremental-cache/file-system-cache.js
generated
vendored
Normal file
141
kitabcitab/node_modules/next/dist/server/lib/incremental-cache/file-system-cache.js
generated
vendored
Normal file
@@ -0,0 +1,141 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _lruCache = _interopRequireDefault(require("next/dist/compiled/lru-cache"));
|
||||
var _path = _interopRequireDefault(require("../../../shared/lib/isomorphic/path"));
|
||||
class FileSystemCache {
|
||||
constructor(ctx){
|
||||
this.fs = ctx.fs;
|
||||
this.flushToDisk = ctx.flushToDisk;
|
||||
this.serverDistDir = ctx.serverDistDir;
|
||||
this.appDir = !!ctx._appDir;
|
||||
if (ctx.maxMemoryCacheSize && !memoryCache) {
|
||||
memoryCache = new _lruCache.default({
|
||||
max: ctx.maxMemoryCacheSize,
|
||||
length ({ value }) {
|
||||
var ref;
|
||||
if (!value) {
|
||||
return 25;
|
||||
} else if (value.kind === "REDIRECT") {
|
||||
return JSON.stringify(value.props).length;
|
||||
} else if (value.kind === "IMAGE") {
|
||||
throw new Error("invariant image should not be incremental-cache");
|
||||
} else if (value.kind === "FETCH") {
|
||||
return JSON.stringify(value.data || "").length;
|
||||
}
|
||||
// rough estimate of size of cache value
|
||||
return value.html.length + (((ref = JSON.stringify(value.pageData)) == null ? void 0 : ref.length) || 0);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
async get(key, fetchCache) {
|
||||
let data = memoryCache == null ? void 0 : memoryCache.get(key);
|
||||
// let's check the disk for seed data
|
||||
if (!data) {
|
||||
try {
|
||||
const { filePath , isAppPath } = await this.getFsPath({
|
||||
pathname: fetchCache ? key : `${key}.html`,
|
||||
fetchCache
|
||||
});
|
||||
const fileData = await this.fs.readFile(filePath);
|
||||
const { mtime } = await this.fs.stat(filePath);
|
||||
if (fetchCache) {
|
||||
const lastModified = mtime.getTime();
|
||||
data = {
|
||||
lastModified,
|
||||
value: JSON.parse(fileData)
|
||||
};
|
||||
} else {
|
||||
const pageData = isAppPath ? await this.fs.readFile((await this.getFsPath({
|
||||
pathname: `${key}.rsc`,
|
||||
appDir: true
|
||||
})).filePath) : JSON.parse(await this.fs.readFile(await (await this.getFsPath({
|
||||
pathname: `${key}.json`,
|
||||
appDir: false
|
||||
})).filePath));
|
||||
data = {
|
||||
lastModified: mtime.getTime(),
|
||||
value: {
|
||||
kind: "PAGE",
|
||||
html: fileData,
|
||||
pageData
|
||||
}
|
||||
};
|
||||
}
|
||||
if (data) {
|
||||
memoryCache == null ? void 0 : memoryCache.set(key, data);
|
||||
}
|
||||
} catch (_) {
|
||||
// unable to get data from disk
|
||||
}
|
||||
}
|
||||
return data || null;
|
||||
}
|
||||
async set(key, data) {
|
||||
memoryCache == null ? void 0 : memoryCache.set(key, {
|
||||
value: data,
|
||||
lastModified: Date.now()
|
||||
});
|
||||
if (!this.flushToDisk) return;
|
||||
if ((data == null ? void 0 : data.kind) === "PAGE") {
|
||||
const isAppPath = typeof data.pageData === "string";
|
||||
const { filePath: htmlPath } = await this.getFsPath({
|
||||
pathname: `${key}.html`,
|
||||
appDir: isAppPath
|
||||
});
|
||||
await this.fs.mkdir(_path.default.dirname(htmlPath));
|
||||
await this.fs.writeFile(htmlPath, data.html);
|
||||
await this.fs.writeFile((await this.getFsPath({
|
||||
pathname: `${key}.${isAppPath ? "rsc" : "json"}`,
|
||||
appDir: isAppPath
|
||||
})).filePath, isAppPath ? data.pageData : JSON.stringify(data.pageData));
|
||||
} else if ((data == null ? void 0 : data.kind) === "FETCH") {
|
||||
const { filePath } = await this.getFsPath({
|
||||
pathname: key,
|
||||
fetchCache: true
|
||||
});
|
||||
await this.fs.mkdir(_path.default.dirname(filePath));
|
||||
await this.fs.writeFile(filePath, JSON.stringify(data));
|
||||
}
|
||||
}
|
||||
async getFsPath({ pathname , appDir , fetchCache }) {
|
||||
if (fetchCache) {
|
||||
// we store in .next/cache/fetch-cache so it can be persisted
|
||||
// across deploys
|
||||
return {
|
||||
filePath: _path.default.join(this.serverDistDir, "..", "cache", "fetch-cache", pathname),
|
||||
isAppPath: false
|
||||
};
|
||||
}
|
||||
let isAppPath = false;
|
||||
let filePath = _path.default.join(this.serverDistDir, "pages", pathname);
|
||||
if (!this.appDir || appDir === false) return {
|
||||
filePath,
|
||||
isAppPath
|
||||
};
|
||||
try {
|
||||
await this.fs.readFile(filePath);
|
||||
return {
|
||||
filePath,
|
||||
isAppPath
|
||||
};
|
||||
} catch (err) {
|
||||
return {
|
||||
filePath: _path.default.join(this.serverDistDir, "app", pathname),
|
||||
isAppPath: true
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.default = FileSystemCache;
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
let memoryCache;
|
||||
|
||||
//# sourceMappingURL=file-system-cache.js.map
|
||||
1
kitabcitab/node_modules/next/dist/server/lib/incremental-cache/file-system-cache.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/lib/incremental-cache/file-system-cache.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
46
kitabcitab/node_modules/next/dist/server/lib/incremental-cache/index.d.ts
generated
vendored
Normal file
46
kitabcitab/node_modules/next/dist/server/lib/incremental-cache/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
import type { CacheFs } from '../../../shared/lib/utils';
|
||||
import { PrerenderManifest } from '../../../build';
|
||||
import { IncrementalCacheValue, IncrementalCacheEntry } from '../../response-cache';
|
||||
export interface CacheHandlerContext {
|
||||
fs: CacheFs;
|
||||
dev?: boolean;
|
||||
flushToDisk?: boolean;
|
||||
serverDistDir: string;
|
||||
maxMemoryCacheSize?: number;
|
||||
_appDir: boolean;
|
||||
_requestHeaders: IncrementalCache['requestHeaders'];
|
||||
}
|
||||
export interface CacheHandlerValue {
|
||||
lastModified?: number;
|
||||
value: IncrementalCacheValue | null;
|
||||
}
|
||||
export declare class CacheHandler {
|
||||
constructor(_ctx: CacheHandlerContext);
|
||||
get(_key: string, _fetchCache?: boolean): Promise<CacheHandlerValue | null>;
|
||||
set(_key: string, _data: IncrementalCacheValue | null, _fetchCache?: boolean): Promise<void>;
|
||||
}
|
||||
export declare class IncrementalCache {
|
||||
dev?: boolean;
|
||||
cacheHandler: CacheHandler;
|
||||
prerenderManifest: PrerenderManifest;
|
||||
requestHeaders: Record<string, undefined | string | string[]>;
|
||||
minimalMode?: boolean;
|
||||
constructor({ fs, dev, appDir, flushToDisk, fetchCache, minimalMode, serverDistDir, requestHeaders, maxMemoryCacheSize, getPrerenderManifest, incrementalCacheHandlerPath, }: {
|
||||
fs: CacheFs;
|
||||
dev: boolean;
|
||||
appDir?: boolean;
|
||||
fetchCache?: boolean;
|
||||
minimalMode?: boolean;
|
||||
serverDistDir: string;
|
||||
flushToDisk?: boolean;
|
||||
requestHeaders: IncrementalCache['requestHeaders'];
|
||||
maxMemoryCacheSize?: number;
|
||||
incrementalCacheHandlerPath?: string;
|
||||
getPrerenderManifest: () => PrerenderManifest;
|
||||
});
|
||||
private calculateRevalidate;
|
||||
_getPathname(pathname: string, fetchCache?: boolean): string;
|
||||
fetchCacheKey(url: string, init?: RequestInit): Promise<string>;
|
||||
get(pathname: string, fetchCache?: boolean): Promise<IncrementalCacheEntry | null>;
|
||||
set(pathname: string, data: IncrementalCacheValue | null, revalidateSeconds?: number | false, fetchCache?: boolean): Promise<void>;
|
||||
}
|
||||
172
kitabcitab/node_modules/next/dist/server/lib/incremental-cache/index.js
generated
vendored
Normal file
172
kitabcitab/node_modules/next/dist/server/lib/incremental-cache/index.js
generated
vendored
Normal file
@@ -0,0 +1,172 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
var _fileSystemCache = _interopRequireDefault(require("./file-system-cache"));
|
||||
var _path = _interopRequireDefault(require("../../../shared/lib/isomorphic/path"));
|
||||
var _normalizePagePath = require("../../../shared/lib/page-path/normalize-page-path");
|
||||
var _fetchCache = _interopRequireDefault(require("./fetch-cache"));
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function toRoute(pathname) {
|
||||
return pathname.replace(/\/$/, "").replace(/\/index$/, "") || "/";
|
||||
}
|
||||
class CacheHandler {
|
||||
// eslint-disable-next-line
|
||||
constructor(_ctx){}
|
||||
async get(_key, _fetchCache) {
|
||||
return {};
|
||||
}
|
||||
async set(_key, _data, _fetchCache) {}
|
||||
}
|
||||
exports.CacheHandler = CacheHandler;
|
||||
class IncrementalCache {
|
||||
constructor({ fs , dev , appDir , flushToDisk , fetchCache , minimalMode , serverDistDir , requestHeaders , maxMemoryCacheSize , getPrerenderManifest , incrementalCacheHandlerPath }){
|
||||
let cacheHandlerMod = _fileSystemCache.default;
|
||||
if (process.env.NEXT_RUNTIME !== "edge" && incrementalCacheHandlerPath) {
|
||||
cacheHandlerMod = require(incrementalCacheHandlerPath);
|
||||
cacheHandlerMod = cacheHandlerMod.default || cacheHandlerMod;
|
||||
}
|
||||
if (minimalMode && fetchCache) {
|
||||
cacheHandlerMod = _fetchCache.default;
|
||||
}
|
||||
if (process.env.__NEXT_TEST_MAX_ISR_CACHE) {
|
||||
// Allow cache size to be overridden for testing purposes
|
||||
maxMemoryCacheSize = parseInt(process.env.__NEXT_TEST_MAX_ISR_CACHE, 10);
|
||||
}
|
||||
this.dev = dev;
|
||||
this.minimalMode = minimalMode;
|
||||
this.requestHeaders = requestHeaders;
|
||||
this.prerenderManifest = getPrerenderManifest();
|
||||
this.cacheHandler = new cacheHandlerMod({
|
||||
dev,
|
||||
fs,
|
||||
flushToDisk,
|
||||
serverDistDir,
|
||||
maxMemoryCacheSize,
|
||||
_appDir: !!appDir,
|
||||
_requestHeaders: requestHeaders
|
||||
});
|
||||
}
|
||||
calculateRevalidate(pathname, fromTime) {
|
||||
// in development we don't have a prerender-manifest
|
||||
// and default to always revalidating to allow easier debugging
|
||||
if (this.dev) return new Date().getTime() - 1000;
|
||||
// if an entry isn't present in routes we fallback to a default
|
||||
// of revalidating after 1 second
|
||||
const { initialRevalidateSeconds } = this.prerenderManifest.routes[toRoute(pathname)] || {
|
||||
initialRevalidateSeconds: 1
|
||||
};
|
||||
const revalidateAfter = typeof initialRevalidateSeconds === "number" ? initialRevalidateSeconds * 1000 + fromTime : initialRevalidateSeconds;
|
||||
return revalidateAfter;
|
||||
}
|
||||
_getPathname(pathname, fetchCache) {
|
||||
return fetchCache ? pathname : (0, _normalizePagePath).normalizePagePath(pathname);
|
||||
}
|
||||
// x-ref: https://github.com/facebook/react/blob/2655c9354d8e1c54ba888444220f63e836925caa/packages/react/src/ReactFetch.js#L23
|
||||
async fetchCacheKey(url, init = {}) {
|
||||
const cacheString = JSON.stringify([
|
||||
url,
|
||||
init.method,
|
||||
init.headers,
|
||||
init.mode,
|
||||
init.redirect,
|
||||
init.credentials,
|
||||
init.referrer,
|
||||
init.referrerPolicy,
|
||||
init.integrity,
|
||||
init.next,
|
||||
init.cache,
|
||||
]);
|
||||
let cacheKey;
|
||||
if (process.env.NEXT_RUNTIME === "edge") {
|
||||
function bufferToHex(buffer) {
|
||||
return Array.prototype.map.call(new Uint8Array(buffer), (b)=>b.toString(16).padStart(2, "0")).join("");
|
||||
}
|
||||
const buffer1 = new TextEncoder().encode(cacheString);
|
||||
cacheKey = bufferToHex(await crypto.subtle.digest("SHA-256", buffer1));
|
||||
} else {
|
||||
const crypto = require("crypto");
|
||||
cacheKey = crypto.createHash("sha256").update(cacheString).digest("hex");
|
||||
}
|
||||
return cacheKey;
|
||||
}
|
||||
// get data from cache if available
|
||||
async get(pathname, fetchCache) {
|
||||
var ref, ref1;
|
||||
// we don't leverage the prerender cache in dev mode
|
||||
// so that getStaticProps is always called for easier debugging
|
||||
if (this.dev) return null;
|
||||
pathname = this._getPathname(pathname, fetchCache);
|
||||
let entry = null;
|
||||
const cacheData = await this.cacheHandler.get(pathname, fetchCache);
|
||||
if ((cacheData == null ? void 0 : (ref = cacheData.value) == null ? void 0 : ref.kind) === "FETCH") {
|
||||
const data = cacheData.value.data;
|
||||
const age = Math.round((Date.now() - (cacheData.lastModified || 0)) / 1000);
|
||||
const revalidate = cacheData.value.revalidate;
|
||||
return {
|
||||
isStale: age > revalidate,
|
||||
value: {
|
||||
kind: "FETCH",
|
||||
data,
|
||||
age,
|
||||
revalidate,
|
||||
isStale: age > revalidate
|
||||
},
|
||||
revalidateAfter: (cacheData.lastModified || Date.now()) + revalidate * 1000
|
||||
};
|
||||
}
|
||||
const curRevalidate = (ref1 = this.prerenderManifest.routes[toRoute(pathname)]) == null ? void 0 : ref1.initialRevalidateSeconds;
|
||||
const revalidateAfter = this.calculateRevalidate(pathname, (cacheData == null ? void 0 : cacheData.lastModified) || Date.now());
|
||||
const isStale = revalidateAfter !== false && revalidateAfter < Date.now() ? true : undefined;
|
||||
if (cacheData) {
|
||||
entry = {
|
||||
isStale,
|
||||
curRevalidate,
|
||||
revalidateAfter,
|
||||
value: cacheData.value
|
||||
};
|
||||
}
|
||||
if (!cacheData && this.prerenderManifest.notFoundRoutes.includes(pathname)) {
|
||||
// for the first hit after starting the server the cache
|
||||
// may not have a way to save notFound: true so if
|
||||
// the prerender-manifest marks this as notFound then we
|
||||
// return that entry and trigger a cache set to give it a
|
||||
// chance to update in-memory entries
|
||||
entry = {
|
||||
isStale,
|
||||
value: null,
|
||||
curRevalidate,
|
||||
revalidateAfter
|
||||
};
|
||||
this.set(pathname, entry.value, curRevalidate, fetchCache);
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
// populate the incremental cache with new data
|
||||
async set(pathname, data, revalidateSeconds, fetchCache) {
|
||||
if (this.dev) return;
|
||||
pathname = this._getPathname(pathname, fetchCache);
|
||||
try {
|
||||
// we use the prerender manifest memory instance
|
||||
// to store revalidate timings for calculating
|
||||
// revalidateAfter values so we update this on set
|
||||
if (typeof revalidateSeconds !== "undefined" && !fetchCache) {
|
||||
this.prerenderManifest.routes[pathname] = {
|
||||
dataRoute: _path.default.posix.join("/_next/data", `${(0, _normalizePagePath).normalizePagePath(pathname)}.json`),
|
||||
srcRoute: null,
|
||||
initialRevalidateSeconds: revalidateSeconds
|
||||
};
|
||||
}
|
||||
await this.cacheHandler.set(pathname, data, fetchCache);
|
||||
} catch (error) {
|
||||
console.warn("Failed to update prerender cache for", pathname, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.IncrementalCache = IncrementalCache;
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
kitabcitab/node_modules/next/dist/server/lib/incremental-cache/index.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/lib/incremental-cache/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7
kitabcitab/node_modules/next/dist/server/lib/mock-request.d.ts
generated
vendored
Normal file
7
kitabcitab/node_modules/next/dist/server/lib/mock-request.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/// <reference types="node" />
|
||||
export declare function mockRequest(requestUrl: string, requestHeaders: Record<string, string | string[] | undefined>, requestMethod: string, requestConnection?: any): {
|
||||
resBuffers: Buffer[];
|
||||
req: any;
|
||||
res: any;
|
||||
streamPromise: Promise<unknown>;
|
||||
};
|
||||
62
kitabcitab/node_modules/next/dist/server/lib/mock-request.js
generated
vendored
Normal file
62
kitabcitab/node_modules/next/dist/server/lib/mock-request.js
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.mockRequest = mockRequest;
|
||||
var _stream = _interopRequireDefault(require("stream"));
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function mockRequest(requestUrl, requestHeaders, requestMethod, requestConnection) {
|
||||
const resBuffers = [];
|
||||
const mockRes = new _stream.default.Writable();
|
||||
const isStreamFinished = new Promise(function(resolve, reject) {
|
||||
mockRes.on("finish", ()=>resolve(true));
|
||||
mockRes.on("end", ()=>resolve(true));
|
||||
mockRes.on("error", (err)=>reject(err));
|
||||
});
|
||||
mockRes.write = (chunk)=>{
|
||||
resBuffers.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
||||
};
|
||||
mockRes._write = (chunk, _encoding, callback)=>{
|
||||
mockRes.write(chunk);
|
||||
// According to Node.js documentation, the callback MUST be invoked to signal that
|
||||
// the write completed successfully. If this callback is not invoked, the 'finish' event
|
||||
// will not be emitted.
|
||||
// https://nodejs.org/docs/latest-v16.x/api/stream.html#writable_writechunk-encoding-callback
|
||||
callback();
|
||||
};
|
||||
const mockHeaders = {};
|
||||
mockRes.writeHead = (_status, _headers)=>Object.assign(mockHeaders, _headers);
|
||||
mockRes.getHeader = (name)=>mockHeaders[name.toLowerCase()];
|
||||
mockRes.getHeaders = ()=>mockHeaders;
|
||||
mockRes.getHeaderNames = ()=>Object.keys(mockHeaders);
|
||||
mockRes.setHeader = (name, value)=>mockHeaders[name.toLowerCase()] = value;
|
||||
mockRes.removeHeader = (name)=>{
|
||||
delete mockHeaders[name.toLowerCase()];
|
||||
};
|
||||
mockRes._implicitHeader = ()=>{};
|
||||
mockRes.connection = requestConnection;
|
||||
mockRes.finished = false;
|
||||
mockRes.statusCode = 200;
|
||||
const mockReq = new _stream.default.Readable();
|
||||
mockReq._read = ()=>{
|
||||
mockReq.emit("end");
|
||||
mockReq.emit("close");
|
||||
return Buffer.from("");
|
||||
};
|
||||
mockReq.headers = requestHeaders;
|
||||
mockReq.method = requestMethod;
|
||||
mockReq.url = requestUrl;
|
||||
mockReq.connection = requestConnection;
|
||||
return {
|
||||
resBuffers,
|
||||
req: mockReq,
|
||||
res: mockRes,
|
||||
streamPromise: isStreamFinished
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=mock-request.js.map
|
||||
1
kitabcitab/node_modules/next/dist/server/lib/mock-request.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/lib/mock-request.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../server/lib/mock-request.ts"],"names":["mockRequest","requestUrl","requestHeaders","requestMethod","requestConnection","resBuffers","mockRes","Stream","Writable","isStreamFinished","Promise","resolve","reject","on","err","write","chunk","push","Buffer","isBuffer","from","_write","_encoding","callback","mockHeaders","writeHead","_status","_headers","Object","assign","getHeader","name","toLowerCase","getHeaders","getHeaderNames","keys","setHeader","value","removeHeader","_implicitHeader","connection","finished","statusCode","mockReq","Readable","_read","emit","headers","method","url","req","res","streamPromise"],"mappings":"AAAA;;;;QAEgBA,WAAW,GAAXA,WAAW;AAFR,IAAA,OAAQ,kCAAR,QAAQ,EAAA;;;;;;AAEpB,SAASA,WAAW,CACzBC,UAAkB,EAClBC,cAA6D,EAC7DC,aAAqB,EACrBC,iBAAuB,EACvB;IACA,MAAMC,UAAU,GAAa,EAAE;IAC/B,MAAMC,OAAO,GAAQ,IAAIC,OAAM,QAAA,CAACC,QAAQ,EAAE;IAE1C,MAAMC,gBAAgB,GAAG,IAAIC,OAAO,CAAC,SAAUC,OAAO,EAAEC,MAAM,EAAE;QAC9DN,OAAO,CAACO,EAAE,CAAC,QAAQ,EAAE,IAAMF,OAAO,CAAC,IAAI,CAAC,CAAC;QACzCL,OAAO,CAACO,EAAE,CAAC,KAAK,EAAE,IAAMF,OAAO,CAAC,IAAI,CAAC,CAAC;QACtCL,OAAO,CAACO,EAAE,CAAC,OAAO,EAAE,CAACC,GAAQ,GAAKF,MAAM,CAACE,GAAG,CAAC,CAAC;KAC/C,CAAC;IAEFR,OAAO,CAACS,KAAK,GAAG,CAACC,KAAsB,GAAK;QAC1CX,UAAU,CAACY,IAAI,CAACC,MAAM,CAACC,QAAQ,CAACH,KAAK,CAAC,GAAGA,KAAK,GAAGE,MAAM,CAACE,IAAI,CAACJ,KAAK,CAAC,CAAC;KACrE;IACDV,OAAO,CAACe,MAAM,GAAG,CACfL,KAAsB,EACtBM,SAAiB,EACjBC,QAAoB,GACjB;QACHjB,OAAO,CAACS,KAAK,CAACC,KAAK,CAAC;QACpB,kFAAkF;QAClF,wFAAwF;QACxF,uBAAuB;QACvB,6FAA6F;QAC7FO,QAAQ,EAAE;KACX;IAED,MAAMC,WAAW,GAAsC,EAAE;IAEzDlB,OAAO,CAACmB,SAAS,GAAG,CAACC,OAAY,EAAEC,QAAa,GAC9CC,MAAM,CAACC,MAAM,CAAC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_modules/next/dist/server/lib/recursive-readdir-sync.d.ts
generated
vendored
Normal file
11
kitabcitab/node_modules/next/dist/server/lib/recursive-readdir-sync.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Recursively read directory
|
||||
* Returns array holding all relative paths
|
||||
*/
|
||||
export declare function recursiveReadDirSync(
|
||||
/** The directory to read */
|
||||
dir: string,
|
||||
/** This doesn't have to be provided, it's used for the recursion */
|
||||
arr?: string[],
|
||||
/** Used to replace the initial path, only the relative path is left, it's faster than path.relative. */
|
||||
rootDir?: string): string[];
|
||||
27
kitabcitab/node_modules/next/dist/server/lib/recursive-readdir-sync.js
generated
vendored
Normal file
27
kitabcitab/node_modules/next/dist/server/lib/recursive-readdir-sync.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.recursiveReadDirSync = recursiveReadDirSync;
|
||||
var _fs = _interopRequireDefault(require("fs"));
|
||||
var _path = require("path");
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function recursiveReadDirSync(/** The directory to read */ dir, /** This doesn't have to be provided, it's used for the recursion */ arr = [], /** Used to replace the initial path, only the relative path is left, it's faster than path.relative. */ rootDir = dir) {
|
||||
const result = _fs.default.readdirSync(dir);
|
||||
result.forEach((part)=>{
|
||||
const absolutePath = (0, _path).join(dir, part);
|
||||
const pathStat = _fs.default.statSync(absolutePath);
|
||||
if (pathStat.isDirectory()) {
|
||||
recursiveReadDirSync(absolutePath, arr, rootDir);
|
||||
return;
|
||||
}
|
||||
arr.push(absolutePath.replace(rootDir, ""));
|
||||
});
|
||||
return arr;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=recursive-readdir-sync.js.map
|
||||
1
kitabcitab/node_modules/next/dist/server/lib/recursive-readdir-sync.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/lib/recursive-readdir-sync.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../server/lib/recursive-readdir-sync.ts"],"names":["recursiveReadDirSync","dir","arr","rootDir","result","fs","readdirSync","forEach","part","absolutePath","join","pathStat","statSync","isDirectory","push","replace"],"mappings":"AAAA;;;;QAOgBA,oBAAoB,GAApBA,oBAAoB;AAPrB,IAAA,GAAI,kCAAJ,IAAI,EAAA;AACE,IAAA,KAAM,WAAN,MAAM,CAAA;;;;;;AAMpB,SAASA,oBAAoB,CAClC,4BAA4B,CAC5BC,GAAW,EACX,oEAAoE,CACpEC,GAAa,GAAG,EAAE,EAClB,wGAAwG,CACxGC,OAAO,GAAGF,GAAG,EACH;IACV,MAAMG,MAAM,GAAGC,GAAE,QAAA,CAACC,WAAW,CAACL,GAAG,CAAC;IAElCG,MAAM,CAACG,OAAO,CAAC,CAACC,IAAY,GAAK;QAC/B,MAAMC,YAAY,GAAGC,CAAAA,GAAAA,KAAI,AAAW,CAAA,KAAX,CAACT,GAAG,EAAEO,IAAI,CAAC;QACpC,MAAMG,QAAQ,GAAGN,GAAE,QAAA,CAACO,QAAQ,CAACH,YAAY,CAAC;QAE1C,IAAIE,QAAQ,CAACE,WAAW,EAAE,EAAE;YAC1Bb,oBAAoB,CAACS,YAAY,EAAEP,GAAG,EAAEC,OAAO,CAAC;YAChD,OAAM;SACP;QACDD,GAAG,CAACY,IAAI,CAACL,YAAY,CAACM,OAAO,CAACZ,OAAO,EAAE,EAAE,CAAC,CAAC;KAC5C,CAAC;IAEF,OAAOD,GAAG,CAAA;CACX"}
|
||||
32
kitabcitab/node_modules/next/dist/server/lib/squoosh/avif/avif_enc.d.ts
generated
vendored
Normal file
32
kitabcitab/node_modules/next/dist/server/lib/squoosh/avif/avif_enc.d.ts
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
// eslint-disable-next-line no-shadow
|
||||
export const enum AVIFTune {
|
||||
auto,
|
||||
psnr,
|
||||
ssim,
|
||||
}
|
||||
|
||||
export interface EncodeOptions {
|
||||
cqLevel: number
|
||||
denoiseLevel: number
|
||||
cqAlphaLevel: number
|
||||
tileRowsLog2: number
|
||||
tileColsLog2: number
|
||||
speed: number
|
||||
subsample: number
|
||||
chromaDeltaQ: boolean
|
||||
sharpness: number
|
||||
tune: AVIFTune
|
||||
}
|
||||
|
||||
export interface AVIFModule extends EmscriptenWasm.Module {
|
||||
encode(
|
||||
data: BufferSource,
|
||||
width: number,
|
||||
height: number,
|
||||
options: EncodeOptions
|
||||
): Uint8Array
|
||||
}
|
||||
|
||||
declare var moduleFactory: EmscriptenWasm.ModuleFactory<AVIFModule>
|
||||
|
||||
export default moduleFactory
|
||||
1528
kitabcitab/node_modules/next/dist/server/lib/squoosh/avif/avif_node_dec.js
generated
vendored
Normal file
1528
kitabcitab/node_modules/next/dist/server/lib/squoosh/avif/avif_node_dec.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
kitabcitab/node_modules/next/dist/server/lib/squoosh/avif/avif_node_dec.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/lib/squoosh/avif/avif_node_dec.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
kitabcitab/node_modules/next/dist/server/lib/squoosh/avif/avif_node_dec.wasm
generated
vendored
Normal file
BIN
kitabcitab/node_modules/next/dist/server/lib/squoosh/avif/avif_node_dec.wasm
generated
vendored
Normal file
Binary file not shown.
1717
kitabcitab/node_modules/next/dist/server/lib/squoosh/avif/avif_node_enc.js
generated
vendored
Normal file
1717
kitabcitab/node_modules/next/dist/server/lib/squoosh/avif/avif_node_enc.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
kitabcitab/node_modules/next/dist/server/lib/squoosh/avif/avif_node_enc.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/lib/squoosh/avif/avif_node_enc.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
kitabcitab/node_modules/next/dist/server/lib/squoosh/avif/avif_node_enc.wasm
generated
vendored
Normal file
BIN
kitabcitab/node_modules/next/dist/server/lib/squoosh/avif/avif_node_enc.wasm
generated
vendored
Normal file
Binary file not shown.
158
kitabcitab/node_modules/next/dist/server/lib/squoosh/codecs.d.ts
generated
vendored
Normal file
158
kitabcitab/node_modules/next/dist/server/lib/squoosh/codecs.d.ts
generated
vendored
Normal file
@@ -0,0 +1,158 @@
|
||||
/// <reference types="node" />
|
||||
interface DecodeModule extends EmscriptenWasm.Module {
|
||||
decode: (data: Uint8Array) => ImageData;
|
||||
}
|
||||
export interface ResizeOptions {
|
||||
width?: number;
|
||||
height?: number;
|
||||
method: 'triangle' | 'catrom' | 'mitchell' | 'lanczos3';
|
||||
premultiply: boolean;
|
||||
linearRGB: boolean;
|
||||
}
|
||||
export interface RotateOptions {
|
||||
numRotations: number;
|
||||
}
|
||||
import type { MozJPEGModule as MozJPEGEncodeModule } from './mozjpeg/mozjpeg_enc';
|
||||
import type { WebPModule as WebPEncodeModule } from './webp/webp_enc';
|
||||
import type { AVIFModule as AVIFEncodeModule } from './avif/avif_enc';
|
||||
import ImageData from './image_data';
|
||||
export declare const preprocessors: {
|
||||
readonly resize: {
|
||||
readonly name: "Resize";
|
||||
readonly description: "Resize the image before compressing";
|
||||
readonly instantiate: () => Promise<(buffer: Uint8Array, input_width: number, input_height: number, { width, height, method, premultiply, linearRGB }: ResizeOptions) => ImageData>;
|
||||
readonly defaultOptions: {
|
||||
readonly method: "lanczos3";
|
||||
readonly fitMethod: "stretch";
|
||||
readonly premultiply: true;
|
||||
readonly linearRGB: true;
|
||||
};
|
||||
};
|
||||
readonly rotate: {
|
||||
readonly name: "Rotate";
|
||||
readonly description: "Rotate image";
|
||||
readonly instantiate: () => Promise<(buffer: Uint8Array, width: number, height: number, { numRotations }: RotateOptions) => Promise<ImageData>>;
|
||||
readonly defaultOptions: {
|
||||
readonly numRotations: 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
export declare const codecs: {
|
||||
readonly mozjpeg: {
|
||||
readonly name: "MozJPEG";
|
||||
readonly extension: "jpg";
|
||||
readonly detectors: readonly [RegExp];
|
||||
readonly dec: () => Promise<DecodeModule>;
|
||||
readonly enc: () => Promise<MozJPEGEncodeModule>;
|
||||
readonly defaultEncoderOptions: {
|
||||
readonly quality: 75;
|
||||
readonly baseline: false;
|
||||
readonly arithmetic: false;
|
||||
readonly progressive: true;
|
||||
readonly optimize_coding: true;
|
||||
readonly smoothing: 0;
|
||||
readonly color_space: 3;
|
||||
readonly quant_table: 3;
|
||||
readonly trellis_multipass: false;
|
||||
readonly trellis_opt_zero: false;
|
||||
readonly trellis_opt_table: false;
|
||||
readonly trellis_loops: 1;
|
||||
readonly auto_subsample: true;
|
||||
readonly chroma_subsample: 2;
|
||||
readonly separate_chroma_quality: false;
|
||||
readonly chroma_quality: 75;
|
||||
};
|
||||
readonly autoOptimize: {
|
||||
readonly option: "quality";
|
||||
readonly min: 0;
|
||||
readonly max: 100;
|
||||
};
|
||||
};
|
||||
readonly webp: {
|
||||
readonly name: "WebP";
|
||||
readonly extension: "webp";
|
||||
readonly detectors: readonly [RegExp];
|
||||
readonly dec: () => Promise<DecodeModule>;
|
||||
readonly enc: () => Promise<WebPEncodeModule>;
|
||||
readonly defaultEncoderOptions: {
|
||||
readonly quality: 75;
|
||||
readonly target_size: 0;
|
||||
readonly target_PSNR: 0;
|
||||
readonly method: 4;
|
||||
readonly sns_strength: 50;
|
||||
readonly filter_strength: 60;
|
||||
readonly filter_sharpness: 0;
|
||||
readonly filter_type: 1;
|
||||
readonly partitions: 0;
|
||||
readonly segments: 4;
|
||||
readonly pass: 1;
|
||||
readonly show_compressed: 0;
|
||||
readonly preprocessing: 0;
|
||||
readonly autofilter: 0;
|
||||
readonly partition_limit: 0;
|
||||
readonly alpha_compression: 1;
|
||||
readonly alpha_filtering: 1;
|
||||
readonly alpha_quality: 100;
|
||||
readonly lossless: 0;
|
||||
readonly exact: 0;
|
||||
readonly image_hint: 0;
|
||||
readonly emulate_jpeg_size: 0;
|
||||
readonly thread_level: 0;
|
||||
readonly low_memory: 0;
|
||||
readonly near_lossless: 100;
|
||||
readonly use_delta_palette: 0;
|
||||
readonly use_sharp_yuv: 0;
|
||||
};
|
||||
readonly autoOptimize: {
|
||||
readonly option: "quality";
|
||||
readonly min: 0;
|
||||
readonly max: 100;
|
||||
};
|
||||
};
|
||||
readonly avif: {
|
||||
readonly name: "AVIF";
|
||||
readonly extension: "avif";
|
||||
readonly detectors: readonly [RegExp];
|
||||
readonly dec: () => Promise<DecodeModule>;
|
||||
readonly enc: () => Promise<AVIFEncodeModule>;
|
||||
readonly defaultEncoderOptions: {
|
||||
readonly cqLevel: 33;
|
||||
readonly cqAlphaLevel: -1;
|
||||
readonly denoiseLevel: 0;
|
||||
readonly tileColsLog2: 0;
|
||||
readonly tileRowsLog2: 0;
|
||||
readonly speed: 6;
|
||||
readonly subsample: 1;
|
||||
readonly chromaDeltaQ: false;
|
||||
readonly sharpness: 0;
|
||||
readonly tune: 0;
|
||||
};
|
||||
readonly autoOptimize: {
|
||||
readonly option: "cqLevel";
|
||||
readonly min: 62;
|
||||
readonly max: 0;
|
||||
};
|
||||
};
|
||||
readonly oxipng: {
|
||||
readonly name: "OxiPNG";
|
||||
readonly extension: "png";
|
||||
readonly detectors: readonly [RegExp];
|
||||
readonly dec: () => Promise<{
|
||||
decode: (buffer: Buffer | Uint8Array) => any;
|
||||
}>;
|
||||
readonly enc: () => Promise<{
|
||||
encode: (buffer: Uint8ClampedArray | ArrayBuffer, width: number, height: number, opts: {
|
||||
level: number;
|
||||
}) => any;
|
||||
}>;
|
||||
readonly defaultEncoderOptions: {
|
||||
readonly level: 2;
|
||||
};
|
||||
readonly autoOptimize: {
|
||||
readonly option: "level";
|
||||
readonly min: 6;
|
||||
readonly max: 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
export {};
|
||||
310
kitabcitab/node_modules/next/dist/server/lib/squoosh/codecs.js
generated
vendored
Normal file
310
kitabcitab/node_modules/next/dist/server/lib/squoosh/codecs.js
generated
vendored
Normal file
@@ -0,0 +1,310 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.codecs = exports.preprocessors = void 0;
|
||||
var _fs = require("fs");
|
||||
var path = _interopRequireWildcard(require("path"));
|
||||
var _emscriptenUtilsJs = require("./emscripten-utils.js");
|
||||
var _mozjpegNodeEncJs = _interopRequireDefault(require("./mozjpeg/mozjpeg_node_enc.js"));
|
||||
var _mozjpegNodeDecJs = _interopRequireDefault(require("./mozjpeg/mozjpeg_node_dec.js"));
|
||||
var _webpNodeEncJs = _interopRequireDefault(require("./webp/webp_node_enc.js"));
|
||||
var _webpNodeDecJs = _interopRequireDefault(require("./webp/webp_node_dec.js"));
|
||||
var _avifNodeEncJs = _interopRequireDefault(require("./avif/avif_node_enc.js"));
|
||||
var _avifNodeDecJs = _interopRequireDefault(require("./avif/avif_node_dec.js"));
|
||||
var pngEncDec = _interopRequireWildcard(require("./png/squoosh_png.js"));
|
||||
var oxipng = _interopRequireWildcard(require("./png/squoosh_oxipng.js"));
|
||||
var resize = _interopRequireWildcard(require("./resize/squoosh_resize.js"));
|
||||
var _imageData = _interopRequireDefault(require("./image_data"));
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function _getRequireWildcardCache() {
|
||||
if (typeof WeakMap !== "function") return null;
|
||||
var cache = new WeakMap();
|
||||
_getRequireWildcardCache = function() {
|
||||
return cache;
|
||||
};
|
||||
return cache;
|
||||
}
|
||||
function _interopRequireWildcard(obj) {
|
||||
if (obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
||||
return {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
var cache = _getRequireWildcardCache();
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {};
|
||||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for(var key in obj){
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
const mozEncWasm = path.resolve(__dirname, "./mozjpeg/mozjpeg_node_enc.wasm");
|
||||
const mozDecWasm = path.resolve(__dirname, "./mozjpeg/mozjpeg_node_dec.wasm");
|
||||
const webpEncWasm = path.resolve(__dirname, "./webp/webp_node_enc.wasm");
|
||||
const webpDecWasm = path.resolve(__dirname, "./webp/webp_node_dec.wasm");
|
||||
const avifEncWasm = path.resolve(__dirname, "./avif/avif_node_enc.wasm");
|
||||
const avifDecWasm = path.resolve(__dirname, "./avif/avif_node_dec.wasm");
|
||||
const pngEncDecWasm = path.resolve(__dirname, "./png/squoosh_png_bg.wasm");
|
||||
const pngEncDecInit = ()=>pngEncDec.default(_fs.promises.readFile((0, _emscriptenUtilsJs).pathify(pngEncDecWasm)));
|
||||
const oxipngWasm = path.resolve(__dirname, "./png/squoosh_oxipng_bg.wasm");
|
||||
const oxipngInit = ()=>oxipng.default(_fs.promises.readFile((0, _emscriptenUtilsJs).pathify(oxipngWasm)));
|
||||
const resizeWasm = path.resolve(__dirname, "./resize/squoosh_resize_bg.wasm");
|
||||
const resizeInit = ()=>resize.default(_fs.promises.readFile((0, _emscriptenUtilsJs).pathify(resizeWasm)));
|
||||
// rotate
|
||||
const rotateWasm = path.resolve(__dirname, "./rotate/rotate.wasm");
|
||||
globalThis.ImageData = _imageData.default;
|
||||
function resizeNameToIndex(name) {
|
||||
switch(name){
|
||||
case "triangle":
|
||||
return 0;
|
||||
case "catrom":
|
||||
return 1;
|
||||
case "mitchell":
|
||||
return 2;
|
||||
case "lanczos3":
|
||||
return 3;
|
||||
default:
|
||||
throw Error(`Unknown resize algorithm "${name}"`);
|
||||
}
|
||||
}
|
||||
function resizeWithAspect({ input_width , input_height , target_width , target_height }) {
|
||||
if (!target_width && !target_height) {
|
||||
throw Error("Need to specify at least width or height when resizing");
|
||||
}
|
||||
if (target_width && target_height) {
|
||||
return {
|
||||
width: target_width,
|
||||
height: target_height
|
||||
};
|
||||
}
|
||||
if (!target_width) {
|
||||
return {
|
||||
width: Math.round(input_width / input_height * target_height),
|
||||
height: target_height
|
||||
};
|
||||
}
|
||||
return {
|
||||
width: target_width,
|
||||
height: Math.round(input_height / input_width * target_width)
|
||||
};
|
||||
}
|
||||
const preprocessors = {
|
||||
resize: {
|
||||
name: "Resize",
|
||||
description: "Resize the image before compressing",
|
||||
instantiate: async ()=>{
|
||||
await resizeInit();
|
||||
return (buffer, input_width, input_height, { width , height , method , premultiply , linearRGB })=>{
|
||||
({ width , height } = resizeWithAspect({
|
||||
input_width,
|
||||
input_height,
|
||||
target_width: width,
|
||||
target_height: height
|
||||
}));
|
||||
const imageData = new _imageData.default(resize.resize(buffer, input_width, input_height, width, height, resizeNameToIndex(method), premultiply, linearRGB), width, height);
|
||||
resize.cleanup();
|
||||
return imageData;
|
||||
};
|
||||
},
|
||||
defaultOptions: {
|
||||
method: "lanczos3",
|
||||
fitMethod: "stretch",
|
||||
premultiply: true,
|
||||
linearRGB: true
|
||||
}
|
||||
},
|
||||
rotate: {
|
||||
name: "Rotate",
|
||||
description: "Rotate image",
|
||||
instantiate: async ()=>{
|
||||
return async (buffer, width, height, { numRotations })=>{
|
||||
const degrees = numRotations * 90 % 360;
|
||||
const sameDimensions = degrees === 0 || degrees === 180;
|
||||
const size = width * height * 4;
|
||||
const instance = (await WebAssembly.instantiate(await _fs.promises.readFile((0, _emscriptenUtilsJs).pathify(rotateWasm)))).instance;
|
||||
const { memory } = instance.exports;
|
||||
const additionalPagesNeeded = Math.ceil((size * 2 - memory.buffer.byteLength + 8) / (64 * 1024));
|
||||
if (additionalPagesNeeded > 0) {
|
||||
memory.grow(additionalPagesNeeded);
|
||||
}
|
||||
const view = new Uint8ClampedArray(memory.buffer);
|
||||
view.set(buffer, 8);
|
||||
instance.exports.rotate(width, height, degrees);
|
||||
return new _imageData.default(view.slice(size + 8, size * 2 + 8), sameDimensions ? width : height, sameDimensions ? height : width);
|
||||
};
|
||||
},
|
||||
defaultOptions: {
|
||||
numRotations: 0
|
||||
}
|
||||
}
|
||||
};
|
||||
exports.preprocessors = preprocessors;
|
||||
const codecs = {
|
||||
mozjpeg: {
|
||||
name: "MozJPEG",
|
||||
extension: "jpg",
|
||||
detectors: [
|
||||
/^\xFF\xD8\xFF/
|
||||
],
|
||||
dec: ()=>(0, _emscriptenUtilsJs).instantiateEmscriptenWasm(_mozjpegNodeDecJs.default, mozDecWasm),
|
||||
enc: ()=>(0, _emscriptenUtilsJs).instantiateEmscriptenWasm(_mozjpegNodeEncJs.default, mozEncWasm),
|
||||
defaultEncoderOptions: {
|
||||
quality: 75,
|
||||
baseline: false,
|
||||
arithmetic: false,
|
||||
progressive: true,
|
||||
optimize_coding: true,
|
||||
smoothing: 0,
|
||||
color_space: 3 /*YCbCr*/ ,
|
||||
quant_table: 3,
|
||||
trellis_multipass: false,
|
||||
trellis_opt_zero: false,
|
||||
trellis_opt_table: false,
|
||||
trellis_loops: 1,
|
||||
auto_subsample: true,
|
||||
chroma_subsample: 2,
|
||||
separate_chroma_quality: false,
|
||||
chroma_quality: 75
|
||||
},
|
||||
autoOptimize: {
|
||||
option: "quality",
|
||||
min: 0,
|
||||
max: 100
|
||||
}
|
||||
},
|
||||
webp: {
|
||||
name: "WebP",
|
||||
extension: "webp",
|
||||
detectors: [
|
||||
/^RIFF....WEBPVP8[LX ]/s
|
||||
],
|
||||
dec: ()=>(0, _emscriptenUtilsJs).instantiateEmscriptenWasm(_webpNodeDecJs.default, webpDecWasm),
|
||||
enc: ()=>(0, _emscriptenUtilsJs).instantiateEmscriptenWasm(_webpNodeEncJs.default, webpEncWasm),
|
||||
defaultEncoderOptions: {
|
||||
quality: 75,
|
||||
target_size: 0,
|
||||
target_PSNR: 0,
|
||||
method: 4,
|
||||
sns_strength: 50,
|
||||
filter_strength: 60,
|
||||
filter_sharpness: 0,
|
||||
filter_type: 1,
|
||||
partitions: 0,
|
||||
segments: 4,
|
||||
pass: 1,
|
||||
show_compressed: 0,
|
||||
preprocessing: 0,
|
||||
autofilter: 0,
|
||||
partition_limit: 0,
|
||||
alpha_compression: 1,
|
||||
alpha_filtering: 1,
|
||||
alpha_quality: 100,
|
||||
lossless: 0,
|
||||
exact: 0,
|
||||
image_hint: 0,
|
||||
emulate_jpeg_size: 0,
|
||||
thread_level: 0,
|
||||
low_memory: 0,
|
||||
near_lossless: 100,
|
||||
use_delta_palette: 0,
|
||||
use_sharp_yuv: 0
|
||||
},
|
||||
autoOptimize: {
|
||||
option: "quality",
|
||||
min: 0,
|
||||
max: 100
|
||||
}
|
||||
},
|
||||
avif: {
|
||||
name: "AVIF",
|
||||
extension: "avif",
|
||||
// eslint-disable-next-line no-control-regex
|
||||
detectors: [
|
||||
/^\x00\x00\x00 ftypavif\x00\x00\x00\x00/
|
||||
],
|
||||
dec: ()=>(0, _emscriptenUtilsJs).instantiateEmscriptenWasm(_avifNodeDecJs.default, avifDecWasm),
|
||||
enc: async ()=>{
|
||||
return (0, _emscriptenUtilsJs).instantiateEmscriptenWasm(_avifNodeEncJs.default, avifEncWasm);
|
||||
},
|
||||
defaultEncoderOptions: {
|
||||
cqLevel: 33,
|
||||
cqAlphaLevel: -1,
|
||||
denoiseLevel: 0,
|
||||
tileColsLog2: 0,
|
||||
tileRowsLog2: 0,
|
||||
speed: 6,
|
||||
subsample: 1,
|
||||
chromaDeltaQ: false,
|
||||
sharpness: 0,
|
||||
tune: 0 /* AVIFTune.auto */
|
||||
},
|
||||
autoOptimize: {
|
||||
option: "cqLevel",
|
||||
min: 62,
|
||||
max: 0
|
||||
}
|
||||
},
|
||||
oxipng: {
|
||||
name: "OxiPNG",
|
||||
extension: "png",
|
||||
// eslint-disable-next-line no-control-regex
|
||||
detectors: [
|
||||
/^\x89PNG\x0D\x0A\x1A\x0A/
|
||||
],
|
||||
dec: async ()=>{
|
||||
await pngEncDecInit();
|
||||
return {
|
||||
decode: (buffer)=>{
|
||||
const imageData = pngEncDec.decode(buffer);
|
||||
pngEncDec.cleanup();
|
||||
return imageData;
|
||||
}
|
||||
};
|
||||
},
|
||||
enc: async ()=>{
|
||||
await pngEncDecInit();
|
||||
await oxipngInit();
|
||||
return {
|
||||
encode: (buffer, width, height, opts)=>{
|
||||
const simplePng = pngEncDec.encode(new Uint8Array(buffer), width, height);
|
||||
const imageData = oxipng.optimise(simplePng, opts.level, false);
|
||||
oxipng.cleanup();
|
||||
return imageData;
|
||||
}
|
||||
};
|
||||
},
|
||||
defaultEncoderOptions: {
|
||||
level: 2
|
||||
},
|
||||
autoOptimize: {
|
||||
option: "level",
|
||||
min: 6,
|
||||
max: 1
|
||||
}
|
||||
}
|
||||
};
|
||||
exports.codecs = codecs;
|
||||
|
||||
//# sourceMappingURL=codecs.js.map
|
||||
1
kitabcitab/node_modules/next/dist/server/lib/squoosh/codecs.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/lib/squoosh/codecs.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
121
kitabcitab/node_modules/next/dist/server/lib/squoosh/emscripten-types.d.ts
generated
vendored
Normal file
121
kitabcitab/node_modules/next/dist/server/lib/squoosh/emscripten-types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
// These types roughly model the object that the JS files generated by Emscripten define. Copied from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/emscripten/index.d.ts and turned into a type definition rather than a global to support our way of using Emscripten.
|
||||
declare namespace EmscriptenWasm {
|
||||
type ModuleFactory<T extends Module = Module> = (
|
||||
moduleOverrides?: ModuleOpts
|
||||
) => Promise<T>
|
||||
|
||||
type EnvironmentType = 'WEB' | 'NODE' | 'SHELL' | 'WORKER'
|
||||
|
||||
// Options object for modularized Emscripten files. Shoe-horned by @surma.
|
||||
// FIXME: This an incomplete definition!
|
||||
interface ModuleOpts {
|
||||
mainScriptUrlOrBlob?: string
|
||||
noInitialRun?: boolean
|
||||
locateFile?: (url: string) => string
|
||||
onRuntimeInitialized?: () => void
|
||||
}
|
||||
|
||||
interface Module {
|
||||
print(str: string): void
|
||||
printErr(str: string): void
|
||||
arguments: string[]
|
||||
environment: EnvironmentType
|
||||
preInit: { (): void }[]
|
||||
preRun: { (): void }[]
|
||||
postRun: { (): void }[]
|
||||
preinitializedWebGLContext: WebGLRenderingContext
|
||||
noInitialRun: boolean
|
||||
noExitRuntime: boolean
|
||||
logReadFiles: boolean
|
||||
filePackagePrefixURL: string
|
||||
wasmBinary: ArrayBuffer
|
||||
|
||||
destroy(object: object): void
|
||||
getPreloadedPackage(
|
||||
remotePackageName: string,
|
||||
remotePackageSize: number
|
||||
): ArrayBuffer
|
||||
instantiateWasm(
|
||||
imports: WebAssembly.Imports,
|
||||
successCallback: (module: WebAssembly.Module) => void
|
||||
): WebAssembly.Exports
|
||||
locateFile(url: string): string
|
||||
onCustomMessage(event: MessageEvent): void
|
||||
|
||||
Runtime: any
|
||||
|
||||
ccall(
|
||||
ident: string,
|
||||
returnType: string | null,
|
||||
argTypes: string[],
|
||||
args: any[]
|
||||
): any
|
||||
cwrap(ident: string, returnType: string | null, argTypes: string[]): any
|
||||
|
||||
setValue(ptr: number, value: any, type: string, noSafe?: boolean): void
|
||||
getValue(ptr: number, type: string, noSafe?: boolean): number
|
||||
|
||||
ALLOC_NORMAL: number
|
||||
ALLOC_STACK: number
|
||||
ALLOC_STATIC: number
|
||||
ALLOC_DYNAMIC: number
|
||||
ALLOC_NONE: number
|
||||
|
||||
allocate(slab: any, types: string, allocator: number, ptr: number): number
|
||||
allocate(slab: any, types: string[], allocator: number, ptr: number): number
|
||||
|
||||
Pointer_stringify(ptr: number, length?: number): string
|
||||
UTF16ToString(ptr: number): string
|
||||
stringToUTF16(str: string, outPtr: number): void
|
||||
UTF32ToString(ptr: number): string
|
||||
stringToUTF32(str: string, outPtr: number): void
|
||||
|
||||
// USE_TYPED_ARRAYS == 1
|
||||
HEAP: Int32Array
|
||||
IHEAP: Int32Array
|
||||
FHEAP: Float64Array
|
||||
|
||||
// USE_TYPED_ARRAYS == 2
|
||||
HEAP8: Int8Array
|
||||
HEAP16: Int16Array
|
||||
HEAP32: Int32Array
|
||||
HEAPU8: Uint8Array
|
||||
HEAPU16: Uint16Array
|
||||
HEAPU32: Uint32Array
|
||||
HEAPF32: Float32Array
|
||||
HEAPF64: Float64Array
|
||||
|
||||
TOTAL_STACK: number
|
||||
TOTAL_MEMORY: number
|
||||
FAST_MEMORY: number
|
||||
|
||||
addOnPreRun(cb: () => any): void
|
||||
addOnInit(cb: () => any): void
|
||||
addOnPreMain(cb: () => any): void
|
||||
addOnExit(cb: () => any): void
|
||||
addOnPostRun(cb: () => any): void
|
||||
|
||||
// Tools
|
||||
intArrayFromString(
|
||||
stringy: string,
|
||||
dontAddNull?: boolean,
|
||||
length?: number
|
||||
): number[]
|
||||
intArrayToString(array: number[]): string
|
||||
writeStringToMemory(str: string, buffer: number, dontAddNull: boolean): void
|
||||
writeArrayToMemory(array: number[], buffer: number): void
|
||||
writeAsciiToMemory(str: string, buffer: number, dontAddNull: boolean): void
|
||||
|
||||
addRunDependency(id: any): void
|
||||
removeRunDependency(id: any): void
|
||||
|
||||
preloadedImages: any
|
||||
preloadedAudios: any
|
||||
|
||||
_malloc(size: number): number
|
||||
_free(ptr: number): void
|
||||
|
||||
// Augmentations below by @surma.
|
||||
onRuntimeInitialized: () => void | null
|
||||
}
|
||||
}
|
||||
2
kitabcitab/node_modules/next/dist/server/lib/squoosh/emscripten-utils.d.ts
generated
vendored
Normal file
2
kitabcitab/node_modules/next/dist/server/lib/squoosh/emscripten-utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export declare function pathify(path: string): string;
|
||||
export declare function instantiateEmscriptenWasm<T extends EmscriptenWasm.Module>(factory: EmscriptenWasm.ModuleFactory<T>, path: string, workerJS?: string): Promise<T>;
|
||||
28
kitabcitab/node_modules/next/dist/server/lib/squoosh/emscripten-utils.js
generated
vendored
Normal file
28
kitabcitab/node_modules/next/dist/server/lib/squoosh/emscripten-utils.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.pathify = pathify;
|
||||
exports.instantiateEmscriptenWasm = instantiateEmscriptenWasm;
|
||||
var _url = require("url");
|
||||
function pathify(path) {
|
||||
if (path.startsWith("file://")) {
|
||||
path = (0, _url).fileURLToPath(path);
|
||||
}
|
||||
return path;
|
||||
}
|
||||
function instantiateEmscriptenWasm(factory, path, workerJS = "") {
|
||||
return factory({
|
||||
locateFile (requestPath) {
|
||||
// The glue code generated by emscripten uses the original
|
||||
// file names of the worker file and the wasm binary.
|
||||
// These will have changed in the bundling process and
|
||||
// we need to inject them here.
|
||||
if (requestPath.endsWith(".wasm")) return pathify(path);
|
||||
if (requestPath.endsWith(".worker.js")) return pathify(workerJS);
|
||||
return requestPath;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=emscripten-utils.js.map
|
||||
1
kitabcitab/node_modules/next/dist/server/lib/squoosh/emscripten-utils.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/lib/squoosh/emscripten-utils.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../server/lib/squoosh/emscripten-utils.ts"],"names":["pathify","instantiateEmscriptenWasm","path","startsWith","fileURLToPath","factory","workerJS","locateFile","requestPath","endsWith"],"mappings":"AAAA;;;;QAEgBA,OAAO,GAAPA,OAAO;QAOPC,yBAAyB,GAAzBA,yBAAyB;AATX,IAAA,IAAK,WAAL,KAAK,CAAA;AAE5B,SAASD,OAAO,CAACE,IAAY,EAAU;IAC5C,IAAIA,IAAI,CAACC,UAAU,CAAC,SAAS,CAAC,EAAE;QAC9BD,IAAI,GAAGE,CAAAA,GAAAA,IAAa,AAAM,CAAA,cAAN,CAACF,IAAI,CAAC;KAC3B;IACD,OAAOA,IAAI,CAAA;CACZ;AAEM,SAASD,yBAAyB,CACvCI,OAAwC,EACxCH,IAAY,EACZI,QAAgB,GAAG,EAAE,EACT;IACZ,OAAOD,OAAO,CAAC;QACbE,UAAU,EAACC,WAAW,EAAE;YACtB,0DAA0D;YAC1D,qDAAqD;YACrD,sDAAsD;YACtD,+BAA+B;YAC/B,IAAIA,WAAW,CAACC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAOT,OAAO,CAACE,IAAI,CAAC,CAAA;YACvD,IAAIM,WAAW,CAACC,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAOT,OAAO,CAACM,QAAQ,CAAC,CAAA;YAChE,OAAOE,WAAW,CAAA;SACnB;KACF,CAAC,CAAA;CACH"}
|
||||
9
kitabcitab/node_modules/next/dist/server/lib/squoosh/image_data.d.ts
generated
vendored
Normal file
9
kitabcitab/node_modules/next/dist/server/lib/squoosh/image_data.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
/// <reference types="node" />
|
||||
export default class ImageData {
|
||||
static from(input: ImageData): ImageData;
|
||||
private _data;
|
||||
width: number;
|
||||
height: number;
|
||||
get data(): Buffer;
|
||||
constructor(data: Buffer | Uint8Array | Uint8ClampedArray, width: number, height: number);
|
||||
}
|
||||
27
kitabcitab/node_modules/next/dist/server/lib/squoosh/image_data.js
generated
vendored
Normal file
27
kitabcitab/node_modules/next/dist/server/lib/squoosh/image_data.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
class ImageData {
|
||||
static from(input) {
|
||||
return new ImageData(input.data || input._data, input.width, input.height);
|
||||
}
|
||||
get data() {
|
||||
if (Object.prototype.toString.call(this._data) === "[object Object]") {
|
||||
return Buffer.from(Object.values(this._data));
|
||||
}
|
||||
if (this._data instanceof Buffer || this._data instanceof Uint8Array || this._data instanceof Uint8ClampedArray) {
|
||||
return Buffer.from(this._data);
|
||||
}
|
||||
throw new Error("invariant");
|
||||
}
|
||||
constructor(data, width, height){
|
||||
this._data = data;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
}
|
||||
}
|
||||
exports.default = ImageData;
|
||||
|
||||
//# sourceMappingURL=image_data.js.map
|
||||
1
kitabcitab/node_modules/next/dist/server/lib/squoosh/image_data.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/lib/squoosh/image_data.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../server/lib/squoosh/image_data.ts"],"names":["ImageData","from","input","data","_data","width","height","Object","prototype","toString","call","Buffer","values","Uint8Array","Uint8ClampedArray","Error","constructor"],"mappings":"AAAA;;;;;AAAe,MAAMA,SAAS;IAC5B,OAAOC,IAAI,CAACC,KAAgB,EAAa;QACvC,OAAO,IAAIF,SAAS,CAACE,KAAK,CAACC,IAAI,IAAID,KAAK,CAACE,KAAK,EAAEF,KAAK,CAACG,KAAK,EAAEH,KAAK,CAACI,MAAM,CAAC,CAAA;KAC3E;IAMD,IAAIH,IAAI,GAAW;QACjB,IAAII,MAAM,CAACC,SAAS,CAACC,QAAQ,CAACC,IAAI,CAAC,IAAI,CAACN,KAAK,CAAC,KAAK,iBAAiB,EAAE;YACpE,OAAOO,MAAM,CAACV,IAAI,CAACM,MAAM,CAACK,MAAM,CAAC,IAAI,CAACR,KAAK,CAAC,CAAC,CAAA;SAC9C;QACD,IACE,IAAI,CAACA,KAAK,YAAYO,MAAM,IAC5B,IAAI,CAACP,KAAK,YAAYS,UAAU,IAChC,IAAI,CAACT,KAAK,YAAYU,iBAAiB,EACvC;YACA,OAAOH,MAAM,CAACV,IAAI,CAAC,IAAI,CAACG,KAAK,CAAC,CAAA;SAC/B;QACD,MAAM,IAAIW,KAAK,CAAC,WAAW,CAAC,CAAA;KAC7B;IAEDC,YACEb,IAA6C,EAC7CE,KAAa,EACbC,MAAc,CACd;QACA,IAAI,CAACF,KAAK,GAAGD,IAAI;QACjB,IAAI,CAACE,KAAK,GAAGA,KAAK;QAClB,IAAI,CAACC,MAAM,GAAGA,MAAM;KACrB;CACF;kBAhCoBN,SAAS"}
|
||||
28
kitabcitab/node_modules/next/dist/server/lib/squoosh/impl.d.ts
generated
vendored
Normal file
28
kitabcitab/node_modules/next/dist/server/lib/squoosh/impl.d.ts
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
/// <reference types="node" />
|
||||
import ImageData from './image_data';
|
||||
export declare function decodeBuffer(_buffer: Buffer | Uint8Array): Promise<ImageData>;
|
||||
export declare function rotate(image: ImageData, numRotations: number): Promise<ImageData>;
|
||||
declare type ResizeOpts = {
|
||||
image: ImageData;
|
||||
} & ({
|
||||
width: number;
|
||||
height?: never;
|
||||
} | {
|
||||
height: number;
|
||||
width?: never;
|
||||
} | {
|
||||
height: number;
|
||||
width: number;
|
||||
});
|
||||
export declare function resize({ image, width, height }: ResizeOpts): Promise<ImageData>;
|
||||
export declare function encodeJpeg(image: ImageData, { quality }: {
|
||||
quality: number;
|
||||
}): Promise<Buffer | Uint8Array>;
|
||||
export declare function encodeWebp(image: ImageData, { quality }: {
|
||||
quality: number;
|
||||
}): Promise<Buffer | Uint8Array>;
|
||||
export declare function encodeAvif(image: ImageData, { quality }: {
|
||||
quality: number;
|
||||
}): Promise<Buffer | Uint8Array>;
|
||||
export declare function encodePng(image: ImageData): Promise<Buffer | Uint8Array>;
|
||||
export {};
|
||||
121
kitabcitab/node_modules/next/dist/server/lib/squoosh/impl.js
generated
vendored
Normal file
121
kitabcitab/node_modules/next/dist/server/lib/squoosh/impl.js
generated
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.decodeBuffer = decodeBuffer;
|
||||
exports.rotate = rotate;
|
||||
exports.resize = resize;
|
||||
exports.encodeJpeg = encodeJpeg;
|
||||
exports.encodeWebp = encodeWebp;
|
||||
exports.encodeAvif = encodeAvif;
|
||||
exports.encodePng = encodePng;
|
||||
var _semver = _interopRequireDefault(require("next/dist/compiled/semver"));
|
||||
var _codecs = require("./codecs");
|
||||
var _imageData = _interopRequireDefault(require("./image_data"));
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
// Fixed in Node.js 16.5.0 and newer.
|
||||
// See https://github.com/nodejs/node/pull/39337
|
||||
// Eventually, remove this delay when engines is updated.
|
||||
// See https://github.com/vercel/next.js/blob/1bcc923439f495a1717421e06af7e64c6003072c/packages/next/package.json#L249-L251
|
||||
const FIXED_VERSION = "16.5.0";
|
||||
const DELAY_MS = 1000;
|
||||
let _promise;
|
||||
function delayOnce(ms) {
|
||||
if (!_promise) {
|
||||
_promise = new Promise((resolve)=>{
|
||||
setTimeout(resolve, ms);
|
||||
});
|
||||
}
|
||||
return _promise;
|
||||
}
|
||||
function maybeDelay() {
|
||||
const isAppleM1 = process.arch === "arm64" && process.platform === "darwin";
|
||||
if (isAppleM1 && _semver.default.lt(process.version, FIXED_VERSION)) {
|
||||
return delayOnce(DELAY_MS);
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
async function decodeBuffer(_buffer) {
|
||||
var ref;
|
||||
const buffer = Buffer.from(_buffer);
|
||||
const firstChunk = buffer.slice(0, 16);
|
||||
const firstChunkString = Array.from(firstChunk).map((v)=>String.fromCodePoint(v)).join("");
|
||||
const key = (ref = Object.entries(_codecs.codecs).find(([, { detectors }])=>detectors.some((detector)=>detector.exec(firstChunkString)))) == null ? void 0 : ref[0];
|
||||
if (!key) {
|
||||
throw Error(`Buffer has an unsupported format`);
|
||||
}
|
||||
const encoder = _codecs.codecs[key];
|
||||
const mod = await encoder.dec();
|
||||
const rgba = mod.decode(new Uint8Array(buffer));
|
||||
return rgba;
|
||||
}
|
||||
async function rotate(image, numRotations) {
|
||||
image = _imageData.default.from(image);
|
||||
const m = await _codecs.preprocessors["rotate"].instantiate();
|
||||
return await m(image.data, image.width, image.height, {
|
||||
numRotations
|
||||
});
|
||||
}
|
||||
async function resize({ image , width , height }) {
|
||||
image = _imageData.default.from(image);
|
||||
const p = _codecs.preprocessors["resize"];
|
||||
const m = await p.instantiate();
|
||||
await maybeDelay();
|
||||
return await m(image.data, image.width, image.height, {
|
||||
...p.defaultOptions,
|
||||
width,
|
||||
height
|
||||
});
|
||||
}
|
||||
async function encodeJpeg(image, { quality }) {
|
||||
image = _imageData.default.from(image);
|
||||
const e = _codecs.codecs["mozjpeg"];
|
||||
const m = await e.enc();
|
||||
await maybeDelay();
|
||||
const r = await m.encode(image.data, image.width, image.height, {
|
||||
...e.defaultEncoderOptions,
|
||||
quality
|
||||
});
|
||||
return Buffer.from(r);
|
||||
}
|
||||
async function encodeWebp(image, { quality }) {
|
||||
image = _imageData.default.from(image);
|
||||
const e = _codecs.codecs["webp"];
|
||||
const m = await e.enc();
|
||||
await maybeDelay();
|
||||
const r = await m.encode(image.data, image.width, image.height, {
|
||||
...e.defaultEncoderOptions,
|
||||
quality
|
||||
});
|
||||
return Buffer.from(r);
|
||||
}
|
||||
async function encodeAvif(image, { quality }) {
|
||||
image = _imageData.default.from(image);
|
||||
const e = _codecs.codecs["avif"];
|
||||
const m = await e.enc();
|
||||
await maybeDelay();
|
||||
const val = e.autoOptimize.min || 62;
|
||||
const r = await m.encode(image.data, image.width, image.height, {
|
||||
...e.defaultEncoderOptions,
|
||||
// Think of cqLevel as the "amount" of quantization (0 to 62),
|
||||
// so a lower value yields higher quality (0 to 100).
|
||||
cqLevel: Math.round(val - quality / 100 * val)
|
||||
});
|
||||
return Buffer.from(r);
|
||||
}
|
||||
async function encodePng(image) {
|
||||
image = _imageData.default.from(image);
|
||||
const e = _codecs.codecs["oxipng"];
|
||||
const m = await e.enc();
|
||||
await maybeDelay();
|
||||
const r = await m.encode(image.data, image.width, image.height, {
|
||||
...e.defaultEncoderOptions
|
||||
});
|
||||
return Buffer.from(r);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=impl.js.map
|
||||
1
kitabcitab/node_modules/next/dist/server/lib/squoosh/impl.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/lib/squoosh/impl.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
26
kitabcitab/node_modules/next/dist/server/lib/squoosh/main.d.ts
generated
vendored
Normal file
26
kitabcitab/node_modules/next/dist/server/lib/squoosh/main.d.ts
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
/// <reference types="node" />
|
||||
declare type RotateOperation = {
|
||||
type: 'rotate';
|
||||
numRotations: number;
|
||||
};
|
||||
declare type ResizeOperation = {
|
||||
type: 'resize';
|
||||
} & ({
|
||||
width: number;
|
||||
height?: never;
|
||||
} | {
|
||||
height: number;
|
||||
width?: never;
|
||||
} | {
|
||||
width: number;
|
||||
height: number;
|
||||
});
|
||||
export declare type Operation = RotateOperation | ResizeOperation;
|
||||
export declare type Encoding = 'jpeg' | 'png' | 'webp' | 'avif';
|
||||
export declare function getMetadata(buffer: Buffer): Promise<{
|
||||
width: number;
|
||||
height: number;
|
||||
}>;
|
||||
export declare function processBuffer(buffer: Buffer, operations: Operation[], encoding: Encoding, quality: number): Promise<Buffer>;
|
||||
export declare function decodeBuffer(buffer: Buffer): Promise<import("./image_data").default>;
|
||||
export {};
|
||||
115
kitabcitab/node_modules/next/dist/server/lib/squoosh/main.js
generated
vendored
Normal file
115
kitabcitab/node_modules/next/dist/server/lib/squoosh/main.js
generated
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getMetadata = getMetadata;
|
||||
exports.processBuffer = processBuffer;
|
||||
exports.decodeBuffer = decodeBuffer;
|
||||
var _jestWorker = require("next/dist/compiled/jest-worker");
|
||||
var path = _interopRequireWildcard(require("path"));
|
||||
var _utils = require("../../../shared/lib/utils");
|
||||
var _os = require("os");
|
||||
function _getRequireWildcardCache() {
|
||||
if (typeof WeakMap !== "function") return null;
|
||||
var cache = new WeakMap();
|
||||
_getRequireWildcardCache = function() {
|
||||
return cache;
|
||||
};
|
||||
return cache;
|
||||
}
|
||||
function _interopRequireWildcard(obj) {
|
||||
if (obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
||||
return {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
var cache = _getRequireWildcardCache();
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {};
|
||||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for(var key in obj){
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
const getWorker = (0, _utils).execOnce(()=>new _jestWorker.Worker(path.resolve(__dirname, "impl"), {
|
||||
enableWorkerThreads: true,
|
||||
// There will be at most 6 workers needed since each worker will take
|
||||
// at least 1 operation type.
|
||||
numWorkers: Math.max(1, Math.min((0, _os).cpus().length - 1, 6)),
|
||||
computeWorkerKey: (method)=>method
|
||||
}));
|
||||
async function getMetadata(buffer) {
|
||||
const worker = getWorker();
|
||||
const { width , height } = await worker.decodeBuffer(buffer);
|
||||
return {
|
||||
width,
|
||||
height
|
||||
};
|
||||
}
|
||||
async function processBuffer(buffer, operations, encoding, quality) {
|
||||
const worker = getWorker();
|
||||
let imageData = await worker.decodeBuffer(buffer);
|
||||
for (const operation of operations){
|
||||
if (operation.type === "rotate") {
|
||||
imageData = await worker.rotate(imageData, operation.numRotations);
|
||||
} else if (operation.type === "resize") {
|
||||
const opt = {
|
||||
image: imageData,
|
||||
width: 0,
|
||||
height: 0
|
||||
};
|
||||
if (operation.width && imageData.width && imageData.width > operation.width) {
|
||||
opt.width = operation.width;
|
||||
}
|
||||
if (operation.height && imageData.height && imageData.height > operation.height) {
|
||||
opt.height = operation.height;
|
||||
}
|
||||
if (opt.width > 0 || opt.height > 0) {
|
||||
imageData = await worker.resize(opt);
|
||||
}
|
||||
}
|
||||
}
|
||||
switch(encoding){
|
||||
case "jpeg":
|
||||
return Buffer.from(await worker.encodeJpeg(imageData, {
|
||||
quality
|
||||
}));
|
||||
case "webp":
|
||||
return Buffer.from(await worker.encodeWebp(imageData, {
|
||||
quality
|
||||
}));
|
||||
case "avif":
|
||||
const avifQuality = quality - 20;
|
||||
return Buffer.from(await worker.encodeAvif(imageData, {
|
||||
quality: Math.max(avifQuality, 0)
|
||||
}));
|
||||
case "png":
|
||||
return Buffer.from(await worker.encodePng(imageData));
|
||||
default:
|
||||
throw Error(`Unsupported encoding format`);
|
||||
}
|
||||
}
|
||||
async function decodeBuffer(buffer) {
|
||||
const worker = getWorker();
|
||||
const imageData = await worker.decodeBuffer(buffer);
|
||||
return imageData;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=main.js.map
|
||||
1
kitabcitab/node_modules/next/dist/server/lib/squoosh/main.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/lib/squoosh/main.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../server/lib/squoosh/main.ts"],"names":["getMetadata","processBuffer","decodeBuffer","path","getWorker","execOnce","Worker","resolve","__dirname","enableWorkerThreads","numWorkers","Math","max","min","cpus","length","computeWorkerKey","method","buffer","worker","width","height","operations","encoding","quality","imageData","operation","type","rotate","numRotations","opt","image","resize","Buffer","from","encodeJpeg","encodeWebp","avifQuality","encodeAvif","encodePng","Error"],"mappings":"AAAA;;;;QA8BsBA,WAAW,GAAXA,WAAW;QAQXC,aAAa,GAAbA,aAAa;QAsDbC,YAAY,GAAZA,YAAY;AA5FX,IAAA,WAAgC,WAAhC,gCAAgC,CAAA;AAC3CC,IAAAA,IAAI,mCAAM,MAAM,EAAZ;AACS,IAAA,MAA2B,WAA3B,2BAA2B,CAAA;AAC/B,IAAA,GAAI,WAAJ,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBzB,MAAMC,SAAS,GAAGC,CAAAA,GAAAA,MAAQ,AASzB,CAAA,SATyB,CACxB,IACE,IAAIC,WAAM,OAAA,CAACH,IAAI,CAACI,OAAO,CAACC,SAAS,EAAE,MAAM,CAAC,EAAE;QAC1CC,mBAAmB,EAAE,IAAI;QACzB,qEAAqE;QACrE,6BAA6B;QAC7BC,UAAU,EAAEC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAED,IAAI,CAACE,GAAG,CAACC,CAAAA,GAAAA,GAAI,AAAE,CAAA,KAAF,EAAE,CAACC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QACvDC,gBAAgB,EAAE,CAACC,MAAM,GAAKA,MAAM;KACrC,CAAC,CACL;AAEM,eAAejB,WAAW,CAC/BkB,MAAc,EAC8B;IAC5C,MAAMC,MAAM,GAA4Bf,SAAS,EAAE,AAAO;IAC1D,MAAM,EAAEgB,KAAK,CAAA,EAAEC,MAAM,CAAA,EAAE,GAAG,MAAMF,MAAM,CAACjB,YAAY,CAACgB,MAAM,CAAC;IAC3D,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AO;aAAE,CAAC,CAAC,CAAA;QACrE,KAAK,MAAM;YACT,OAAOS,MAAM,CAACC,IAAI,CAAC,MAAMf,MAAM,CAACiB,UAAU,CAACX,SAAS,EAAE;gBAAED,OAAO;aAAE,CAAC,CAAC,CAAA;QACrE,KAAK,MAAM;YACT,MAAMa,WAAW,GAAGb,OAAO,GAAG,EAAE;YAChC,OAAOS,MAAM,CAACC,IAAI,CAChB,MAAMf,MAAM,CAACmB,UAAU,CAACb,SAAS,EAAE;gBACjCD,OAAO,EAAEb,IAAI,CAACC,GAAG,CAACyB,WAAW,EAAE,CAAC,CAAC;aAClC,CAAC,CACH,CAAA;QACH,KAAK,KAAK;YACR,OAAOJ,MAAM,CAACC,IAAI,CAAC,MAAMf,MAAM,CAACoB,SAAS,CAACd,SAAS,CAAC,CAAC,CAAA;QACvD;YACE,MAAMe,KAAK,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAA;KAC7C;CACF;AAEM,eAAetC,YAAY,CAACgB,MAAc,EAAE;IACjD,MAAMC,MAAM,GAA4Bf,SAAS,EAAE,AAAO;IAC1D,MAAMqB,SAAS,GAAG,MAAMN,MAAM,CAACjB,YAAY,CAACgB,MAAM,CAAC;IACnD,OAAOO,SAAS,CAAA;CACjB"}
|
||||
38
kitabcitab/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_enc.d.ts
generated
vendored
Normal file
38
kitabcitab/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_enc.d.ts
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
// eslint-disable-next-line no-shadow
|
||||
export const enum MozJpegColorSpace {
|
||||
GRAYSCALE = 1,
|
||||
RGB,
|
||||
YCbCr,
|
||||
}
|
||||
|
||||
export interface EncodeOptions {
|
||||
quality: number
|
||||
baseline: boolean
|
||||
arithmetic: boolean
|
||||
progressive: boolean
|
||||
optimize_coding: boolean
|
||||
smoothing: number
|
||||
color_space: MozJpegColorSpace
|
||||
quant_table: number
|
||||
trellis_multipass: boolean
|
||||
trellis_opt_zero: boolean
|
||||
trellis_opt_table: boolean
|
||||
trellis_loops: number
|
||||
auto_subsample: boolean
|
||||
chroma_subsample: number
|
||||
separate_chroma_quality: boolean
|
||||
chroma_quality: number
|
||||
}
|
||||
|
||||
export interface MozJPEGModule extends EmscriptenWasm.Module {
|
||||
encode(
|
||||
data: BufferSource,
|
||||
width: number,
|
||||
height: number,
|
||||
options: EncodeOptions
|
||||
): Uint8Array
|
||||
}
|
||||
|
||||
declare var moduleFactory: EmscriptenWasm.ModuleFactory<MozJPEGModule>
|
||||
|
||||
export default moduleFactory
|
||||
1541
kitabcitab/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_dec.js
generated
vendored
Normal file
1541
kitabcitab/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_dec.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
kitabcitab/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_dec.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_dec.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
kitabcitab/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_dec.wasm
generated
vendored
Normal file
BIN
kitabcitab/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_dec.wasm
generated
vendored
Normal file
Binary file not shown.
1631
kitabcitab/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_enc.js
generated
vendored
Normal file
1631
kitabcitab/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_enc.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
kitabcitab/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_enc.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_enc.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
kitabcitab/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_enc.wasm
generated
vendored
Normal file
BIN
kitabcitab/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_enc.wasm
generated
vendored
Normal file
Binary file not shown.
97
kitabcitab/node_modules/next/dist/server/lib/squoosh/png/squoosh_oxipng.js
generated
vendored
Normal file
97
kitabcitab/node_modules/next/dist/server/lib/squoosh/png/squoosh_oxipng.js
generated
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.optimise = optimise;
|
||||
exports.cleanup = cleanup;
|
||||
exports.default = void 0;
|
||||
let wasm;
|
||||
let cachedTextDecoder = new TextDecoder("utf-8", {
|
||||
ignoreBOM: true,
|
||||
fatal: true
|
||||
});
|
||||
cachedTextDecoder.decode();
|
||||
let cachegetUint8Memory0 = null;
|
||||
function getUint8Memory0() {
|
||||
if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {
|
||||
cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
||||
}
|
||||
return cachegetUint8Memory0;
|
||||
}
|
||||
function getStringFromWasm0(ptr, len) {
|
||||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
||||
}
|
||||
let WASM_VECTOR_LEN = 0;
|
||||
function passArray8ToWasm0(arg, malloc) {
|
||||
const ptr = malloc(arg.length * 1);
|
||||
getUint8Memory0().set(arg, ptr / 1);
|
||||
WASM_VECTOR_LEN = arg.length;
|
||||
return ptr;
|
||||
}
|
||||
let cachegetInt32Memory0 = null;
|
||||
function getInt32Memory0() {
|
||||
if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) {
|
||||
cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
||||
}
|
||||
return cachegetInt32Memory0;
|
||||
}
|
||||
function getArrayU8FromWasm0(ptr, len) {
|
||||
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
||||
}
|
||||
function optimise(data, level, interlace) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
||||
var len0 = WASM_VECTOR_LEN;
|
||||
wasm.optimise(retptr, ptr0, len0, level, interlace);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
||||
wasm.__wbindgen_free(r0, r1 * 1);
|
||||
return v1;
|
||||
} finally{
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
async function load(module, imports) {
|
||||
if (typeof Response === "function" && module instanceof Response) {
|
||||
if (typeof WebAssembly.instantiateStreaming === "function") {
|
||||
return await WebAssembly.instantiateStreaming(module, imports);
|
||||
}
|
||||
const bytes = await module.arrayBuffer();
|
||||
return await WebAssembly.instantiate(bytes, imports);
|
||||
} else {
|
||||
const instance = await WebAssembly.instantiate(module, imports);
|
||||
if (instance instanceof WebAssembly.Instance) {
|
||||
return {
|
||||
instance,
|
||||
module
|
||||
};
|
||||
} else {
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
async function init(input) {
|
||||
const imports = {};
|
||||
imports.wbg = {};
|
||||
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
||||
throw new Error(getStringFromWasm0(arg0, arg1));
|
||||
};
|
||||
if (typeof input === "string" || typeof Request === "function" && input instanceof Request || typeof URL === "function" && input instanceof URL) {
|
||||
input = fetch(input);
|
||||
}
|
||||
const { instance , module } = await load(await input, imports);
|
||||
wasm = instance.exports;
|
||||
init.__wbindgen_wasm_module = module;
|
||||
return wasm;
|
||||
}
|
||||
var _default = init;
|
||||
exports.default = _default;
|
||||
function cleanup() {
|
||||
wasm = null;
|
||||
cachegetUint8Memory0 = null;
|
||||
cachegetInt32Memory0 = null;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=squoosh_oxipng.js.map
|
||||
1
kitabcitab/node_modules/next/dist/server/lib/squoosh/png/squoosh_oxipng.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/lib/squoosh/png/squoosh_oxipng.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../server/lib/squoosh/png/squoosh_oxipng.js"],"names":["optimise","cleanup","wasm","cachedTextDecoder","TextDecoder","ignoreBOM","fatal","decode","cachegetUint8Memory0","getUint8Memory0","buffer","memory","Uint8Array","getStringFromWasm0","ptr","len","subarray","WASM_VECTOR_LEN","passArray8ToWasm0","arg","malloc","length","set","cachegetInt32Memory0","getInt32Memory0","Int32Array","getArrayU8FromWasm0","data","level","interlace","retptr","__wbindgen_add_to_stack_pointer","ptr0","__wbindgen_malloc","len0","r0","r1","v1","slice","__wbindgen_free","load","module","imports","Response","WebAssembly","instantiateStreaming","bytes","arrayBuffer","instantiate","instance","Instance","init","input","wbg","__wbindgen_throw","arg0","arg1","Error","Request","URL","fetch","exports","__wbindgen_wasm_module"],"mappings":"AAAA;;;;QAqDgBA,QAAQ,GAARA,QAAQ;QA6DRC,OAAO,GAAPA,OAAO;;AAlHvB,IAAIC,IAAI;AAER,IAAIC,iBAAiB,GAAG,IAAIC,WAAW,CAAC,OAAO,EAAE;IAC/CC,SAAS,EAAE,IAAI;IACfC,KAAK,EAAE,IAAI;CACZ,CAAC;AAEFH,iBAAiB,CAACI,MAAM,EAAE;AAE1B,IAAIC,oBAAoB,GAAG,IAAI;AAC/B,SAASC,eAAe,GAAG;IACzB,IACED,oBAAoB,KAAK,IAAI,IAC7BA,oBAAoB,CAACE,MAAM,KAAKR,IAAI,CAACS,MAAM,CAACD,MAAM,EAClD;QACAF,oBAAoB,GAAG,IAAII,UAAU,CAACV,IAAI,CAACS,MAAM,CAACD,MA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ACzB,MAAMV,OAAO,GAAG,EAAE;IAClBA,OAAO,CAACW,GAAG,GAAG,EAAE;IAChBX,OAAO,CAACW,GAAG,CAACC,gBAAgB,GAAG,SAAUC,IAAI,EAAEC,IAAI,EAAE;QACnD,MAAM,IAAIC,KAAK,CAAC5C,kBAAkB,CAAC0C,IAAI,EAAEC,IAAI,CAAC,CAAC,CAAA;KAChD;IAED,IACE,OAAOJ,KAAK,KAAK,QAAQ,IACxB,OAAOM,OAAO,KAAK,UAAU,IAAIN,KAAK,YAAYM,OAAO,IACzD,OAAOC,GAAG,KAAK,UAAU,IAAIP,KAAK,YAAYO,GAAG,AAAC,EACnD;QACAP,KAAK,GAAGQ,KAAK,CAACR,KAAK,CAAC;KACrB;IAED,MAAM,EAAEH,QAAQ,CAAA,EAAER,MAAM,CAAA,EAAE,GAAG,MAAMD,IAAI,CAAC,MAAMY,KAAK,EAAEV,OAAO,CAAC;IAE7DxC,IAAI,GAAG+C,QAAQ,CAACY,OAAO;IACvBV,IAAI,CAACW,sBAAsB,GAAGrB,MAAM;IAEpC,OAAOvC,IAAI,CAAA;CACZ;eAEciD,IAAI;;AAGZ,SAASlD,OAAO,GAAG;IACxBC,IAAI,GAAG,IAAI;IACXM,oBAAoB,GAAG,IAAI;IAC3Be,oBAAoB,GAAG,IAAI;CAC5B"}
|
||||
BIN
kitabcitab/node_modules/next/dist/server/lib/squoosh/png/squoosh_oxipng_bg.wasm
generated
vendored
Normal file
BIN
kitabcitab/node_modules/next/dist/server/lib/squoosh/png/squoosh_oxipng_bg.wasm
generated
vendored
Normal file
Binary file not shown.
144
kitabcitab/node_modules/next/dist/server/lib/squoosh/png/squoosh_png.js
generated
vendored
Normal file
144
kitabcitab/node_modules/next/dist/server/lib/squoosh/png/squoosh_png.js
generated
vendored
Normal file
@@ -0,0 +1,144 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.encode = encode;
|
||||
exports.decode = decode;
|
||||
exports.cleanup = cleanup;
|
||||
exports.default = void 0;
|
||||
let wasm;
|
||||
let cachedTextDecoder = new TextDecoder("utf-8", {
|
||||
ignoreBOM: true,
|
||||
fatal: true
|
||||
});
|
||||
cachedTextDecoder.decode();
|
||||
let cachegetUint8Memory0 = null;
|
||||
function getUint8Memory0() {
|
||||
if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {
|
||||
cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
||||
}
|
||||
return cachegetUint8Memory0;
|
||||
}
|
||||
function getStringFromWasm0(ptr, len) {
|
||||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
||||
}
|
||||
let cachegetUint8ClampedMemory0 = null;
|
||||
function getUint8ClampedMemory0() {
|
||||
if (cachegetUint8ClampedMemory0 === null || cachegetUint8ClampedMemory0.buffer !== wasm.memory.buffer) {
|
||||
cachegetUint8ClampedMemory0 = new Uint8ClampedArray(wasm.memory.buffer);
|
||||
}
|
||||
return cachegetUint8ClampedMemory0;
|
||||
}
|
||||
function getClampedArrayU8FromWasm0(ptr, len) {
|
||||
return getUint8ClampedMemory0().subarray(ptr / 1, ptr / 1 + len);
|
||||
}
|
||||
const heap = new Array(32).fill(undefined);
|
||||
heap.push(undefined, null, true, false);
|
||||
let heap_next = heap.length;
|
||||
function addHeapObject(obj) {
|
||||
if (heap_next === heap.length) heap.push(heap.length + 1);
|
||||
const idx = heap_next;
|
||||
heap_next = heap[idx];
|
||||
heap[idx] = obj;
|
||||
return idx;
|
||||
}
|
||||
let WASM_VECTOR_LEN = 0;
|
||||
function passArray8ToWasm0(arg, malloc) {
|
||||
const ptr = malloc(arg.length * 1);
|
||||
getUint8Memory0().set(arg, ptr / 1);
|
||||
WASM_VECTOR_LEN = arg.length;
|
||||
return ptr;
|
||||
}
|
||||
let cachegetInt32Memory0 = null;
|
||||
function getInt32Memory0() {
|
||||
if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) {
|
||||
cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
||||
}
|
||||
return cachegetInt32Memory0;
|
||||
}
|
||||
function getArrayU8FromWasm0(ptr, len) {
|
||||
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
||||
}
|
||||
function encode(data, width, height) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
||||
var len0 = WASM_VECTOR_LEN;
|
||||
wasm.encode(retptr, ptr0, len0, width, height);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
||||
wasm.__wbindgen_free(r0, r1 * 1);
|
||||
return v1;
|
||||
} finally{
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
function getObject(idx) {
|
||||
return heap[idx];
|
||||
}
|
||||
function dropObject(idx) {
|
||||
if (idx < 36) return;
|
||||
heap[idx] = heap_next;
|
||||
heap_next = idx;
|
||||
}
|
||||
function takeObject(idx) {
|
||||
const ret = getObject(idx);
|
||||
dropObject(idx);
|
||||
return ret;
|
||||
}
|
||||
function decode(data) {
|
||||
var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
||||
var len0 = WASM_VECTOR_LEN;
|
||||
var ret = wasm.decode(ptr0, len0);
|
||||
return takeObject(ret);
|
||||
}
|
||||
async function load(module, imports) {
|
||||
if (typeof Response === "function" && module instanceof Response) {
|
||||
if (typeof WebAssembly.instantiateStreaming === "function") {
|
||||
return await WebAssembly.instantiateStreaming(module, imports);
|
||||
}
|
||||
const bytes = await module.arrayBuffer();
|
||||
return await WebAssembly.instantiate(bytes, imports);
|
||||
} else {
|
||||
const instance = await WebAssembly.instantiate(module, imports);
|
||||
if (instance instanceof WebAssembly.Instance) {
|
||||
return {
|
||||
instance,
|
||||
module
|
||||
};
|
||||
} else {
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
async function init(input) {
|
||||
const imports = {};
|
||||
imports.wbg = {};
|
||||
imports.wbg.__wbg_newwithownedu8clampedarrayandsh_787b2db8ea6bfd62 = function(arg0, arg1, arg2, arg3) {
|
||||
var v0 = getClampedArrayU8FromWasm0(arg0, arg1).slice();
|
||||
wasm.__wbindgen_free(arg0, arg1 * 1);
|
||||
var ret = new ImageData(v0, arg2 >>> 0, arg3 >>> 0);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
||||
throw new Error(getStringFromWasm0(arg0, arg1));
|
||||
};
|
||||
if (typeof input === "string" || typeof Request === "function" && input instanceof Request || typeof URL === "function" && input instanceof URL) {
|
||||
input = fetch(input);
|
||||
}
|
||||
const { instance , module } = await load(await input, imports);
|
||||
wasm = instance.exports;
|
||||
init.__wbindgen_wasm_module = module;
|
||||
return wasm;
|
||||
}
|
||||
var _default = init;
|
||||
exports.default = _default;
|
||||
function cleanup() {
|
||||
wasm = null;
|
||||
cachegetUint8ClampedMemory0 = null;
|
||||
cachegetUint8Memory0 = null;
|
||||
cachegetInt32Memory0 = null;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=squoosh_png.js.map
|
||||
1
kitabcitab/node_modules/next/dist/server/lib/squoosh/png/squoosh_png.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/lib/squoosh/png/squoosh_png.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
kitabcitab/node_modules/next/dist/server/lib/squoosh/png/squoosh_png_bg.wasm
generated
vendored
Normal file
BIN
kitabcitab/node_modules/next/dist/server/lib/squoosh/png/squoosh_png_bg.wasm
generated
vendored
Normal file
Binary file not shown.
92
kitabcitab/node_modules/next/dist/server/lib/squoosh/resize/squoosh_resize.js
generated
vendored
Normal file
92
kitabcitab/node_modules/next/dist/server/lib/squoosh/resize/squoosh_resize.js
generated
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.resize = resize;
|
||||
exports.cleanup = cleanup;
|
||||
exports.default = void 0;
|
||||
let wasm;
|
||||
let cachegetUint8Memory0 = null;
|
||||
function getUint8Memory0() {
|
||||
if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {
|
||||
cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
||||
}
|
||||
return cachegetUint8Memory0;
|
||||
}
|
||||
let WASM_VECTOR_LEN = 0;
|
||||
function passArray8ToWasm0(arg, malloc) {
|
||||
const ptr = malloc(arg.length * 1);
|
||||
getUint8Memory0().set(arg, ptr / 1);
|
||||
WASM_VECTOR_LEN = arg.length;
|
||||
return ptr;
|
||||
}
|
||||
let cachegetInt32Memory0 = null;
|
||||
function getInt32Memory0() {
|
||||
if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) {
|
||||
cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
||||
}
|
||||
return cachegetInt32Memory0;
|
||||
}
|
||||
let cachegetUint8ClampedMemory0 = null;
|
||||
function getUint8ClampedMemory0() {
|
||||
if (cachegetUint8ClampedMemory0 === null || cachegetUint8ClampedMemory0.buffer !== wasm.memory.buffer) {
|
||||
cachegetUint8ClampedMemory0 = new Uint8ClampedArray(wasm.memory.buffer);
|
||||
}
|
||||
return cachegetUint8ClampedMemory0;
|
||||
}
|
||||
function getClampedArrayU8FromWasm0(ptr, len) {
|
||||
return getUint8ClampedMemory0().subarray(ptr / 1, ptr / 1 + len);
|
||||
}
|
||||
function resize(input_image, input_width, input_height, output_width, output_height, typ_idx, premultiply, color_space_conversion) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
var ptr0 = passArray8ToWasm0(input_image, wasm.__wbindgen_malloc);
|
||||
var len0 = WASM_VECTOR_LEN;
|
||||
wasm.resize(retptr, ptr0, len0, input_width, input_height, output_width, output_height, typ_idx, premultiply, color_space_conversion);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var v1 = getClampedArrayU8FromWasm0(r0, r1).slice();
|
||||
wasm.__wbindgen_free(r0, r1 * 1);
|
||||
return v1;
|
||||
} finally{
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
async function load(module, imports) {
|
||||
if (typeof Response === "function" && module instanceof Response) {
|
||||
if (typeof WebAssembly.instantiateStreaming === "function") {
|
||||
return await WebAssembly.instantiateStreaming(module, imports);
|
||||
}
|
||||
const bytes = await module.arrayBuffer();
|
||||
return await WebAssembly.instantiate(bytes, imports);
|
||||
} else {
|
||||
const instance = await WebAssembly.instantiate(module, imports);
|
||||
if (instance instanceof WebAssembly.Instance) {
|
||||
return {
|
||||
instance,
|
||||
module
|
||||
};
|
||||
} else {
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
async function init(input) {
|
||||
const imports = {};
|
||||
if (typeof input === "string" || typeof Request === "function" && input instanceof Request || typeof URL === "function" && input instanceof URL) {
|
||||
input = fetch(input);
|
||||
}
|
||||
const { instance , module } = await load(await input, imports);
|
||||
wasm = instance.exports;
|
||||
init.__wbindgen_wasm_module = module;
|
||||
return wasm;
|
||||
}
|
||||
var _default = init;
|
||||
exports.default = _default;
|
||||
function cleanup() {
|
||||
wasm = null;
|
||||
cachegetUint8Memory0 = null;
|
||||
cachegetInt32Memory0 = null;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=squoosh_resize.js.map
|
||||
1
kitabcitab/node_modules/next/dist/server/lib/squoosh/resize/squoosh_resize.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/lib/squoosh/resize/squoosh_resize.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../server/lib/squoosh/resize/squoosh_resize.js"],"names":["resize","cleanup","wasm","cachegetUint8Memory0","getUint8Memory0","buffer","memory","Uint8Array","WASM_VECTOR_LEN","passArray8ToWasm0","arg","malloc","ptr","length","set","cachegetInt32Memory0","getInt32Memory0","Int32Array","cachegetUint8ClampedMemory0","getUint8ClampedMemory0","Uint8ClampedArray","getClampedArrayU8FromWasm0","len","subarray","input_image","input_width","input_height","output_width","output_height","typ_idx","premultiply","color_space_conversion","retptr","__wbindgen_add_to_stack_pointer","ptr0","__wbindgen_malloc","len0","r0","r1","v1","slice","__wbindgen_free","load","module","imports","Response","WebAssembly","instantiateStreaming","bytes","arrayBuffer","instantiate","instance","Instance","init","input","Request","URL","fetch","exports","__wbindgen_wasm_module"],"mappings":"AAAA;;;;QA0DgBA,MAAM,GAANA,MAAM;QA6ENC,OAAO,GAAPA,OAAO;;AAvIvB,IAAIC,IAAI;AAER,IAAIC,oBAAoB,GAAG,IAAI;AAC/B,SAASC,eAAe,GAAG;IACzB,IACED,oBAAoB,KAAK,IAAI,IAC7BA,oBAAoB,CAACE,MAAM,KAAKH,IAAI,CAACI,MAAM,CAACD,MAAM,EAClD;QACAF,oBAAoB,GAAG,IAAII,UAAU,CAACL,IAAI,CAACI,MAAM,CAACD,MAAM,CAAC;KAC1D;IACD,OAAOF,oBAAoB,CAAA;CAC5B;AAED,IAAIK,eAAe,GAAG,CAAC;AAEvB,SAASC,iBAAiB,CAACC,GAAG,EAAEC,MAAM,EAAE;IACtC,MAAMC,GAAG,GAAGD,MAAM,CAACD,GAAG,CAACG,MAAM,GAAG,CAAC,CAAC;IAClCT,eAAe,EAAE,CAACU,GAAG,CAACJ,GAAG,EAAEE,GAAG,GAAG,CAAC,CAAC;IACnCJ,eAAe,GAAGE,GAAG,CAACG,MAAM;IAC5B,OAAOD,GAAG,CAAA;CACX;AAED,IAAIG,oBAAoB,GAAG,IAAI;AAC/B,SAASC,eAAe,GAAG;IACzB,IACED,oB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G,KAAK,CAACH,KAAK,CAAC;KACrB;IAED,MAAM,EAAEH,QAAQ,CAAA,EAAER,MAAM,CAAA,EAAE,GAAG,MAAMD,IAAI,CAAC,MAAMY,KAAK,EAAEV,OAAO,CAAC;IAE7D1C,IAAI,GAAGiD,QAAQ,CAACO,OAAO;IACvBL,IAAI,CAACM,sBAAsB,GAAGhB,MAAM;IAEpC,OAAOzC,IAAI,CAAA;CACZ;eAEcmD,IAAI;;AAGZ,SAASpD,OAAO,GAAG;IACxBC,IAAI,GAAG,IAAI;IACXC,oBAAoB,GAAG,IAAI;IAC3BY,oBAAoB,GAAG,IAAI;CAC5B"}
|
||||
BIN
kitabcitab/node_modules/next/dist/server/lib/squoosh/resize/squoosh_resize_bg.wasm
generated
vendored
Normal file
BIN
kitabcitab/node_modules/next/dist/server/lib/squoosh/resize/squoosh_resize_bg.wasm
generated
vendored
Normal file
Binary file not shown.
BIN
kitabcitab/node_modules/next/dist/server/lib/squoosh/rotate/rotate.wasm
generated
vendored
Normal file
BIN
kitabcitab/node_modules/next/dist/server/lib/squoosh/rotate/rotate.wasm
generated
vendored
Normal file
Binary file not shown.
42
kitabcitab/node_modules/next/dist/server/lib/squoosh/webp/webp_enc.d.ts
generated
vendored
Normal file
42
kitabcitab/node_modules/next/dist/server/lib/squoosh/webp/webp_enc.d.ts
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
export interface EncodeOptions {
|
||||
quality: number
|
||||
target_size: number
|
||||
target_PSNR: number
|
||||
method: number
|
||||
sns_strength: number
|
||||
filter_strength: number
|
||||
filter_sharpness: number
|
||||
filter_type: number
|
||||
partitions: number
|
||||
segments: number
|
||||
pass: number
|
||||
show_compressed: number
|
||||
preprocessing: number
|
||||
autofilter: number
|
||||
partition_limit: number
|
||||
alpha_compression: number
|
||||
alpha_filtering: number
|
||||
alpha_quality: number
|
||||
lossless: number
|
||||
exact: number
|
||||
image_hint: number
|
||||
emulate_jpeg_size: number
|
||||
thread_level: number
|
||||
low_memory: number
|
||||
near_lossless: number
|
||||
use_delta_palette: number
|
||||
use_sharp_yuv: number
|
||||
}
|
||||
|
||||
export interface WebPModule extends EmscriptenWasm.Module {
|
||||
encode(
|
||||
data: BufferSource,
|
||||
width: number,
|
||||
height: number,
|
||||
options: EncodeOptions
|
||||
): Uint8Array
|
||||
}
|
||||
|
||||
declare var moduleFactory: EmscriptenWasm.ModuleFactory<WebPModule>
|
||||
|
||||
export default moduleFactory
|
||||
1390
kitabcitab/node_modules/next/dist/server/lib/squoosh/webp/webp_node_dec.js
generated
vendored
Normal file
1390
kitabcitab/node_modules/next/dist/server/lib/squoosh/webp/webp_node_dec.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
kitabcitab/node_modules/next/dist/server/lib/squoosh/webp/webp_node_dec.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/lib/squoosh/webp/webp_node_dec.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
kitabcitab/node_modules/next/dist/server/lib/squoosh/webp/webp_node_dec.wasm
generated
vendored
Normal file
BIN
kitabcitab/node_modules/next/dist/server/lib/squoosh/webp/webp_node_dec.wasm
generated
vendored
Normal file
Binary file not shown.
1538
kitabcitab/node_modules/next/dist/server/lib/squoosh/webp/webp_node_enc.js
generated
vendored
Normal file
1538
kitabcitab/node_modules/next/dist/server/lib/squoosh/webp/webp_node_enc.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
kitabcitab/node_modules/next/dist/server/lib/squoosh/webp/webp_node_enc.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/lib/squoosh/webp/webp_node_enc.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
kitabcitab/node_modules/next/dist/server/lib/squoosh/webp/webp_node_enc.wasm
generated
vendored
Normal file
BIN
kitabcitab/node_modules/next/dist/server/lib/squoosh/webp/webp_node_enc.wasm
generated
vendored
Normal file
Binary file not shown.
7
kitabcitab/node_modules/next/dist/server/lib/start-server.d.ts
generated
vendored
Normal file
7
kitabcitab/node_modules/next/dist/server/lib/start-server.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { NextServerOptions, NextServer } from '../next';
|
||||
interface StartServerOptions extends NextServerOptions {
|
||||
allowRetry?: boolean;
|
||||
keepAliveTimeout?: number;
|
||||
}
|
||||
export declare function startServer(opts: StartServerOptions): Promise<NextServer>;
|
||||
export {};
|
||||
66
kitabcitab/node_modules/next/dist/server/lib/start-server.js
generated
vendored
Normal file
66
kitabcitab/node_modules/next/dist/server/lib/start-server.js
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.startServer = startServer;
|
||||
var _log = require("../../build/output/log");
|
||||
var _http = _interopRequireDefault(require("http"));
|
||||
var _next = _interopRequireDefault(require("../next"));
|
||||
var _cluster = _interopRequireDefault(require("cluster"));
|
||||
var _v8 = _interopRequireDefault(require("v8"));
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
const MAXIMUM_HEAP_SIZE_ALLOWED = _v8.default.getHeapStatistics().heap_size_limit / 1024 / 1024 * 0.9;
|
||||
function startServer(opts) {
|
||||
let requestHandler;
|
||||
const server = _http.default.createServer((req, res)=>{
|
||||
return requestHandler(req, res).finally(()=>{
|
||||
if (_cluster.default.worker && process.memoryUsage().heapUsed / 1024 / 1024 > MAXIMUM_HEAP_SIZE_ALLOWED) {
|
||||
_cluster.default.worker.kill();
|
||||
}
|
||||
});
|
||||
});
|
||||
if (opts.keepAliveTimeout) {
|
||||
server.keepAliveTimeout = opts.keepAliveTimeout;
|
||||
}
|
||||
return new Promise((resolve, reject)=>{
|
||||
let port = opts.port;
|
||||
let retryCount = 0;
|
||||
server.on("error", (err)=>{
|
||||
if (port && opts.allowRetry && err.code === "EADDRINUSE" && retryCount < 10) {
|
||||
(0, _log).warn(`Port ${port} is in use, trying ${port + 1} instead.`);
|
||||
port += 1;
|
||||
retryCount += 1;
|
||||
server.listen(port, opts.hostname);
|
||||
} else {
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
let upgradeHandler;
|
||||
if (!opts.dev) {
|
||||
server.on("upgrade", (req, socket, upgrade)=>{
|
||||
upgradeHandler(req, socket, upgrade);
|
||||
});
|
||||
}
|
||||
server.on("listening", ()=>{
|
||||
const addr = server.address();
|
||||
const hostname = !opts.hostname || opts.hostname === "0.0.0.0" ? "localhost" : opts.hostname;
|
||||
const app = (0, _next).default({
|
||||
...opts,
|
||||
hostname,
|
||||
customServer: false,
|
||||
httpServer: server,
|
||||
port: addr && typeof addr === "object" ? addr.port : port
|
||||
});
|
||||
requestHandler = app.getRequestHandler();
|
||||
upgradeHandler = app.getUpgradeHandler();
|
||||
resolve(app);
|
||||
});
|
||||
server.listen(port, opts.hostname);
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=start-server.js.map
|
||||
1
kitabcitab/node_modules/next/dist/server/lib/start-server.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/lib/start-server.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../server/lib/start-server.ts"],"names":["startServer","MAXIMUM_HEAP_SIZE_ALLOWED","v8","getHeapStatistics","heap_size_limit","opts","requestHandler","server","http","createServer","req","res","finally","cluster","worker","process","memoryUsage","heapUsed","kill","keepAliveTimeout","Promise","resolve","reject","port","retryCount","on","err","allowRetry","code","warn","listen","hostname","upgradeHandler","dev","socket","upgrade","addr","address","app","next","customServer","httpServer","getRequestHandler","getUpgradeHandler"],"mappings":"AAAA;;;;QAcgBA,WAAW,GAAXA,WAAW;AAbN,IAAA,IAAwB,WAAxB,wBAAwB,CAAA;AAC5B,IAAA,KAAM,kCAAN,MAAM,EAAA;AACN,IAAA,KAAS,kCAAT,SAAS,EAAA;AACN,IAAA,QAAS,kCAAT,SAA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MAAM,CAACuB,MAAM,CAACP,IAAI,EAAElB,IAAI,CAAC0B,QAAQ,CAAC;aACnC,MAAM;gBACLT,MAAM,CAACI,GAAG,CAAC;aACZ;SACF,CAAC;QAEF,IAAIM,cAAc,AAAK;QAEvB,IAAI,CAAC3B,IAAI,CAAC4B,GAAG,EAAE;YACb1B,MAAM,CAACkB,EAAE,CAAC,SAAS,EAAE,CAACf,GAAG,EAAEwB,MAAM,EAAEC,OAAO,GAAK;gBAC7CH,cAAc,CAACtB,GAAG,EAAEwB,MAAM,EAAEC,OAAO,CAAC;aACrC,CAAC;SACH;QAED5B,MAAM,CAACkB,EAAE,CAAC,WAAW,EAAE,IAAM;YAC3B,MAAMW,IAAI,GAAG7B,MAAM,CAAC8B,OAAO,EAAE;YAC7B,MAAMN,QAAQ,GACZ,CAAC1B,IAAI,CAAC0B,QAAQ,IAAI1B,IAAI,CAAC0B,QAAQ,KAAK,SAAS,GACzC,WAAW,GACX1B,IAAI,CAAC0B,QAAQ;YAEnB,MAAMO,GAAG,GAAGC,CAAAA,GAAAA,KAAI,AAMd,CAAA,QANc,CAAC;gBACf,GAAGlC,IAAI;gBACP0B,QAAQ;gBACRS,YAAY,EAAE,KAAK;gBACnBC,UAAU,EAAElC,MAAM;gBAClBgB,IAAI,EAAEa,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,GAAGA,IAAI,CAACb,IAAI,GAAGA,IAAI;aAC1D,CAAC;YAEFjB,cAAc,GAAGgC,GAAG,CAACI,iBAAiB,EAAE;YACxCV,cAAc,GAAGM,GAAG,CAACK,iBAAiB,EAAE;YACxCtB,OAAO,CAACiB,GAAG,CAAC;SACb,CAAC;QAEF/B,MAAM,CAACuB,MAAM,CAACP,IAAI,EAAElB,IAAI,CAAC0B,QAAQ,CAAC;KACnC,CAAC,CAAA;CACH"}
|
||||
4
kitabcitab/node_modules/next/dist/server/lib/utils.d.ts
generated
vendored
Normal file
4
kitabcitab/node_modules/next/dist/server/lib/utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import type arg from 'next/dist/compiled/arg/index.js';
|
||||
export declare function printAndExit(message: string, code?: number): void;
|
||||
export declare function getNodeOptionsWithoutInspect(): string;
|
||||
export declare function getPort(args: arg.Result<arg.Spec>): number;
|
||||
31
kitabcitab/node_modules/next/dist/server/lib/utils.js
generated
vendored
Normal file
31
kitabcitab/node_modules/next/dist/server/lib/utils.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.printAndExit = printAndExit;
|
||||
exports.getNodeOptionsWithoutInspect = getNodeOptionsWithoutInspect;
|
||||
exports.getPort = getPort;
|
||||
function printAndExit(message, code = 1) {
|
||||
if (code === 0) {
|
||||
console.log(message);
|
||||
} else {
|
||||
console.error(message);
|
||||
}
|
||||
process.exit(code);
|
||||
}
|
||||
function getNodeOptionsWithoutInspect() {
|
||||
const NODE_INSPECT_RE = /--inspect(-brk)?(=\S+)?( |$)/;
|
||||
return (process.env.NODE_OPTIONS || "").replace(NODE_INSPECT_RE, "");
|
||||
}
|
||||
function getPort(args) {
|
||||
if (typeof args["--port"] === "number") {
|
||||
return args["--port"];
|
||||
}
|
||||
const parsed = process.env.PORT && parseInt(process.env.PORT, 10);
|
||||
if (typeof parsed === "number" && !Number.isNaN(parsed)) {
|
||||
return parsed;
|
||||
}
|
||||
return 3000;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=utils.js.map
|
||||
1
kitabcitab/node_modules/next/dist/server/lib/utils.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/lib/utils.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../server/lib/utils.ts"],"names":["printAndExit","getNodeOptionsWithoutInspect","getPort","message","code","console","log","error","process","exit","NODE_INSPECT_RE","env","NODE_OPTIONS","replace","args","parsed","PORT","parseInt","Number","isNaN"],"mappings":"AAAA;;;;QAEgBA,YAAY,GAAZA,YAAY;QAUZC,4BAA4B,GAA5BA,4BAA4B;QAK5BC,OAAO,GAAPA,OAAO;AAfhB,SAASF,YAAY,CAACG,OAAe,EAAEC,IAAI,GAAG,CAAC,EAAE;IACtD,IAAIA,IAAI,KAAK,CAAC,EAAE;QACdC,OAAO,CAACC,GAAG,CAACH,OAAO,CAAC;KACrB,MAAM;QACLE,OAAO,CAACE,KAAK,CAACJ,OAAO,CAAC;KACvB;IAEDK,OAAO,CAACC,IAAI,CAACL,IAAI,CAAC;CACnB;AAEM,SAASH,4BAA4B,GAAG;IAC7C,MAAMS,eAAe,iCAAiC;IACtD,OAAO,CAACF,OAAO,CAACG,GAAG,CAACC,YAAY,IAAI,EAAE,CAAC,CAACC,OAAO,CAACH,eAAe,EAAE,EAAE,CAAC,CAAA;CACrE;AAEM,SAASR,OAAO,CAACY,IAA0B,EAAU;IAC1D,IAAI,OAAOA,IAAI,CAAC,QAAQ,CAAC,KAAK,QAAQ,EAAE;QACtC,OAAOA,IAAI,CAAC,QAAQ,CAAC,CAAA;KACtB;IAED,MAAMC,MAAM,GAAGP,OAAO,CAACG,GAAG,CAACK,IAAI,IAAIC,QAAQ,CAACT,OAAO,CAACG,GAAG,CAACK,IAAI,EAAE,EAAE,CAAC;IACjE,IAAI,OAAOD,MAAM,KAAK,QAAQ,IAAI,CAACG,MAAM,CAACC,KAAK,CAACJ,MAAM,CAAC,EAAE;QACvD,OAAOA,MAAM,CAAA;KACd;IAED,OAAO,IAAI,CAAA;CACZ"}
|
||||
Reference in New Issue
Block a user