/opt/canhelp/node_modules/next/dist/server/lib
NameSizeModeActions
cache-handlers/-0755rm
experimental/-0755rm
incremental-cache/-0755rm
module-loader/-0755rm
router-utils/-0755rm
server-ipc/-0755rm
trace/-0755rm
app-dir-module.d.ts6230644editdlrm
app-dir-module.js16750644editdlrm
app-dir-module.js.map26320644editdlrm
app-info-log.d.ts6170644editdlrm
app-info-log.js48460644editdlrm
app-info-log.js.map58670644editdlrm
async-callback-set.d.ts1400644editdlrm
async-callback-set.js7330644editdlrm
async-callback-set.js.map11130644editdlrm
cache-control.d.ts5720644editdlrm
cache-control.js8150644editdlrm
cache-control.js.map16230644editdlrm
chrome-devtools-workspace.d.ts4180644editdlrm
chrome-devtools-workspace.js43680644editdlrm
chrome-devtools-workspace.js.map41900644editdlrm
clone-response.d.ts5310644editdlrm
clone-response.js26410644editdlrm
clone-response.js.map44410644editdlrm
cpu-profile.d.ts1120644editdlrm
cpu-profile.js10340644editdlrm
cpu-profile.js.map20620644editdlrm
decode-query-path-parameter.d.ts1890644editdlrm
decode-query-path-parameter.js6880644editdlrm
decode-query-path-parameter.js.map7550644editdlrm
dedupe-fetch.d.ts1470644editdlrm
dedupe-fetch.js67850644editdlrm
dedupe-fetch.js.map73960644editdlrm
dev-bundler-service.d.ts11830644editdlrm
dev-bundler-service.js32380644editdlrm
dev-bundler-service.js.map57920644editdlrm
disk-lru-cache.external.d.ts8080644editdlrm
disk-lru-cache.external.js19150644editdlrm
disk-lru-cache.external.js.map31460644editdlrm
etag.d.ts4530644editdlrm
etag.js15850644editdlrm
etag.js.map21980644editdlrm
find-page-file.d.ts13950644editdlrm
find-page-file.js54210644editdlrm
find-page-file.js.map94400644editdlrm
fix-mojibake.d.ts600644editdlrm
fix-mojibake.js7270644editdlrm
fix-mojibake.js.map10410644editdlrm
format-hostname.d.ts2150644editdlrm
format-hostname.js4080644editdlrm
format-hostname.js.map6100644editdlrm
i18n-provider.d.ts23910644editdlrm
i18n-provider.js55930644editdlrm
i18n-provider.js.map90460644editdlrm
implicit-tags.d.ts9860644editdlrm
implicit-tags.js26850644editdlrm
implicit-tags.js.map52120644editdlrm
is-ipv6.d.ts520644editdlrm
is-ipv6.js22840644editdlrm
is-ipv6.js.map34070644editdlrm
lazy-result.d.ts5650644editdlrm
lazy-result.js12460644editdlrm
lazy-result.js.map19070644editdlrm
lru-cache.d.ts36610644editdlrm
lru-cache.js66430644editdlrm
lru-cache.js.map113580644editdlrm
match-next-data-pathname.d.ts1130644editdlrm
match-next-data-pathname.js5510644editdlrm
match-next-data-pathname.js.map6360644editdlrm
mock-request.d.ts41250644editdlrm
mock-request.js144950644editdlrm
mock-request.js.map212690644editdlrm
node-fs-methods.d.ts930644editdlrm
node-fs-methods.js7720644editdlrm
node-fs-methods.js.map9760644editdlrm
parse-stack.d.ts2930644editdlrm
parse-stack.js17990644editdlrm
parse-stack.js.map29910644editdlrm
patch-fetch.d.ts9580644editdlrm
patch-fetch.js459600644editdlrm
patch-fetch.js.map647100644editdlrm
patch-set-header.d.ts4640644editdlrm
patch-set-header.js14520644editdlrm
patch-set-header.js.map24630644editdlrm
render-server.d.ts38030644editdlrm
render-server.js39380644editdlrm
render-server.js.map63770644editdlrm
router-server.d.ts8160644editdlrm
router-server.js330710644editdlrm
router-server.js.map464730644editdlrm
server-action-request-meta.d.ts5370644editdlrm
server-action-request-meta.js21160644editdlrm
server-action-request-meta.js.map30700644editdlrm
source-maps.d.ts19760644editdlrm
source-maps.js90100644editdlrm
source-maps.js.map149080644editdlrm
start-server.d.ts10600644editdlrm
start-server.js195790644editdlrm
start-server.js.map276000644editdlrm
streaming-metadata.d.ts2740644editdlrm
streaming-metadata.js11370644editdlrm
streaming-metadata.js.map15880644editdlrm
to-route.d.ts5060644editdlrm
to-route.js7780644editdlrm
to-route.js.map8630644editdlrm
types.d.ts2910644editdlrm
types.js1150644editdlrm
types.js.map670644editdlrm
utils.d.ts29660644editdlrm
utils.js83120644editdlrm
utils.js.map136580644editdlrm
worker-utils.d.ts570644editdlrm
worker-utils.js11280644editdlrm
worker-utils.js.map11250644editdlrm
Edit: /opt/canhelp/node_modules/next/dist/server/lib/utils.js (8312B)
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); 0 && (module.exports = { RESTART_EXIT_CODE: null, formatDebugAddress: null, formatNodeOptions: null, getFormattedDebugAddress: null, getFormattedNodeOptionsWithoutInspect: null, getMaxOldSpaceSize: null, getNodeDebugType: null, getParsedDebugAddress: null, getParsedNodeOptionsWithoutInspect: null, parseValidPositiveInteger: null, printAndExit: null, tokenizeArgs: null }); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { RESTART_EXIT_CODE: function() { return RESTART_EXIT_CODE; }, formatDebugAddress: function() { return formatDebugAddress; }, formatNodeOptions: function() { return formatNodeOptions; }, getFormattedDebugAddress: function() { return getFormattedDebugAddress; }, getFormattedNodeOptionsWithoutInspect: function() { return getFormattedNodeOptionsWithoutInspect; }, getMaxOldSpaceSize: function() { return getMaxOldSpaceSize; }, getNodeDebugType: function() { return getNodeDebugType; }, getParsedDebugAddress: function() { return getParsedDebugAddress; }, getParsedNodeOptionsWithoutInspect: function() { return getParsedNodeOptionsWithoutInspect; }, parseValidPositiveInteger: function() { return parseValidPositiveInteger; }, printAndExit: function() { return printAndExit; }, tokenizeArgs: function() { return tokenizeArgs; } }); const _nodeutil = require("node:util"); const _commander = require("next/dist/compiled/commander"); function printAndExit(message, code = 1) { if (code === 0) { console.log(message); } else { console.error(message); } return process.exit(code); } const parseNodeArgs = (args)=>{ const { values, tokens } = (0, _nodeutil.parseArgs)({ args, strict: false, tokens: true }); // For the `NODE_OPTIONS`, we support arguments with values without the `=` // sign. We need to parse them manually. let orphan = null; for(let i = 0; i < tokens.length; i++){ const token = tokens[i]; if (token.kind === 'option-terminator') { break; } // When we encounter an option, if it's value is undefined, we should check // to see if the following tokens are positional parameters. If they are, // then the option is orphaned, and we can assign it. if (token.kind === 'option') { orphan = typeof token.value === 'undefined' ? token : null; continue; } // If the token isn't a positional one, then we can't assign it to the found // orphaned option. if (token.kind !== 'positional') { orphan = null; continue; } // If we don't have an orphan, then we can skip this token. if (!orphan) { continue; } // If the token is a positional one, and it has a value, so add it to the // values object. If it already exists, append it with a space. if (orphan.name in values && typeof values[orphan.name] === 'string') { values[orphan.name] += ` ${token.value}`; } else { values[orphan.name] = token.value; } } return values; }; const tokenizeArgs = (input)=>{ let args = []; let isInString = false; let willStartNewArg = true; for(let i = 0; i < input.length; i++){ let char = input[i]; // Skip any escaped characters in strings. if (char === '\\' && isInString) { // Ensure we don't have an escape character at the end. if (input.length === i + 1) { throw Object.defineProperty(new Error('Invalid escape character at the end.'), "__NEXT_ERROR_CODE", { value: "E168", enumerable: false, configurable: true }); } // Skip the next character. char = input[++i]; } else if (char === ' ' && !isInString) { willStartNewArg = true; continue; } else if (char === '"') { isInString = !isInString; continue; } // If we're starting a new argument, we should add it to the array. if (willStartNewArg) { args.push(char); willStartNewArg = false; } else { args[args.length - 1] += char; } } if (isInString) { throw Object.defineProperty(new Error('Unterminated string'), "__NEXT_ERROR_CODE", { value: "E208", enumerable: false, configurable: true }); } return args; }; /** * Get the node options from the environment variable `NODE_OPTIONS` and returns * them as an array of strings. * * @returns An array of strings with the node options. */ const getNodeOptionsArgs = ()=>{ if (!process.env.NODE_OPTIONS) return []; return tokenizeArgs(process.env.NODE_OPTIONS); }; const formatDebugAddress = ({ host, port })=>{ if (host) return `${host}:${port}`; return `${port}`; }; const getParsedDebugAddress = ()=>{ const args = getNodeOptionsArgs(); if (args.length === 0) return { host: undefined, port: 9229 }; const parsed = parseNodeArgs(args); // We expect to find the debug port in one of these options. The first one // found will be used. const address = parsed.inspect ?? parsed['inspect-brk'] ?? parsed['inspect_brk']; if (!address || typeof address !== 'string') { return { host: undefined, port: 9229 }; } // The address is in the form of `[host:]port`. Let's parse the address. if (address.includes(':')) { const [host, port] = address.split(':'); return { host, port: parseInt(port, 10) }; } return { host: undefined, port: parseInt(address, 10) }; }; const getFormattedDebugAddress = ()=>formatDebugAddress(getParsedDebugAddress()); function formatNodeOptions(args) { return Object.entries(args).map(([key, value])=>{ if (value === true) { return `--${key}`; } if (value) { return `--${key}=${// Values with spaces need to be quoted. We use JSON.stringify to // also escape any nested quotes. value.includes(' ') && !value.startsWith('"') ? JSON.stringify(value) : value}`; } return null; }).filter((arg)=>arg !== null).join(' '); } function getParsedNodeOptionsWithoutInspect() { const args = getNodeOptionsArgs(); if (args.length === 0) return {}; const parsed = parseNodeArgs(args); // Remove inspect options. delete parsed.inspect; delete parsed['inspect-brk']; delete parsed['inspect_brk']; return parsed; } function getFormattedNodeOptionsWithoutInspect() { const args = getParsedNodeOptionsWithoutInspect(); if (Object.keys(args).length === 0) return ''; return formatNodeOptions(args); } function parseValidPositiveInteger(value) { const parsedValue = parseInt(value, 10); if (isNaN(parsedValue) || !isFinite(parsedValue) || parsedValue < 0) { throw new _commander.InvalidArgumentError(`'${value}' is not a non-negative number.`); } return parsedValue; } const RESTART_EXIT_CODE = 77; function getNodeDebugType() { const args = [ ...process.execArgv, ...getNodeOptionsArgs() ]; if (args.length === 0) return; const parsed = parseNodeArgs(args); if (parsed.inspect) return 'inspect'; if (parsed['inspect-brk'] || parsed['inspect_brk']) return 'inspect-brk'; } function getMaxOldSpaceSize() { const args = getNodeOptionsArgs(); if (args.length === 0) return; const parsed = parseNodeArgs(args); const size = parsed['max-old-space-size'] || parsed['max_old_space_size']; if (!size || typeof size !== 'string') return; return parseInt(size, 10); } //# sourceMappingURL=utils.js.map