/
opt
/
canhelp
/
node_modules
/
next
/
dist
/
server
/
/opt/canhelp/node_modules/next/dist/server
mkdir
upload
Name
Size
Mode
Actions
after/
-
0755
rm
api-utils/
-
0755
rm
app-render/
-
0755
rm
async-storage/
-
0755
rm
base-http/
-
0755
rm
dev/
-
0755
rm
instrumentation/
-
0755
rm
lib/
-
0755
rm
node-environment-extensions/
-
0755
rm
normalizers/
-
0755
rm
og/
-
0755
rm
request/
-
0755
rm
response-cache/
-
0755
rm
resume-data-cache/
-
0755
rm
route-definitions/
-
0755
rm
route-matcher-managers/
-
0755
rm
route-matcher-providers/
-
0755
rm
route-matchers/
-
0755
rm
route-matches/
-
0755
rm
route-modules/
-
0755
rm
stream-utils/
-
0755
rm
typescript/
-
0755
rm
use-cache/
-
0755
rm
web/
-
0755
rm
accept-header.d.ts
98
0644
edit
dl
rm
accept-header.js
4062
0644
edit
dl
rm
accept-header.js.map
6474
0644
edit
dl
rm
base-server.d.ts
14818
0644
edit
dl
rm
base-server.js
101770
0644
edit
dl
rm
base-server.js.map
162683
0644
edit
dl
rm
body-streams.d.ts
474
0644
edit
dl
rm
body-streams.js
3655
0644
edit
dl
rm
body-streams.js.map
5442
0644
edit
dl
rm
cache-dir.d.ts
82
0644
edit
dl
rm
cache-dir.js
757
0644
edit
dl
rm
cache-dir.js.map
703
0644
edit
dl
rm
capsize-font-metrics.json
4301622
0644
edit
dl
rm
ci-info.d.ts
124
0644
edit
dl
rm
ci-info.js
1142
0644
edit
dl
rm
ci-info.js.map
1314
0644
edit
dl
rm
client-component-renderer-logger.d.ts
405
0644
edit
dl
rm
client-component-renderer-logger.js
2287
0644
edit
dl
rm
client-component-renderer-logger.js.map
3036
0644
edit
dl
rm
config-schema.d.ts
151
0644
edit
dl
rm
config-schema.js
30336
0644
edit
dl
rm
config-schema.js.map
56748
0644
edit
dl
rm
config-shared.d.ts
49280
0644
edit
dl
rm
config-shared.js
7278
0644
edit
dl
rm
config-shared.js.map
58064
0644
edit
dl
rm
config-utils.d.ts
49
0644
edit
dl
rm
config-utils.js
5888
0644
edit
dl
rm
config-utils.js.map
6600
0644
edit
dl
rm
config.d.ts
1159
0644
edit
dl
rm
config.js
74313
0644
edit
dl
rm
config.js.map
99560
0644
edit
dl
rm
create-deduped-by-callsite-server-error-logger.d.ts
591
0644
edit
dl
rm
create-deduped-by-callsite-server-error-logger.js
3584
0644
edit
dl
rm
create-deduped-by-callsite-server-error-logger.js.map
3667
0644
edit
dl
rm
crypto-utils.d.ts
171
0644
edit
dl
rm
crypto-utils.js
3026
0644
edit
dl
rm
crypto-utils.js.map
4369
0644
edit
dl
rm
dynamic-rendering-utils.d.ts
425
0644
edit
dl
rm
dynamic-rendering-utils.js
3388
0644
edit
dl
rm
dynamic-rendering-utils.js.map
4939
0644
edit
dl
rm
font-utils.d.ts
177
0644
edit
dl
rm
font-utils.js
1776
0644
edit
dl
rm
font-utils.js.map
3060
0644
edit
dl
rm
get-app-route-from-entrypoint.d.ts
85
0644
edit
dl
rm
get-app-route-from-entrypoint.js
832
0644
edit
dl
rm
get-app-route-from-entrypoint.js.map
865
0644
edit
dl
rm
get-page-files.d.ts
536
0644
edit
dl
rm
get-page-files.js
807
0644
edit
dl
rm
get-page-files.js.map
1692
0644
edit
dl
rm
get-route-from-entrypoint.d.ts
97
0644
edit
dl
rm
get-route-from-entrypoint.js
1245
0644
edit
dl
rm
get-route-from-entrypoint.js.map
1415
0644
edit
dl
rm
htmlescape.d.ts
110
0644
edit
dl
rm
htmlescape.js
986
0644
edit
dl
rm
htmlescape.js.map
1000
0644
edit
dl
rm
image-optimizer.d.ts
4692
0644
edit
dl
rm
image-optimizer.js
37066
0644
edit
dl
rm
image-optimizer.js.map
55523
0644
edit
dl
rm
internal-utils.d.ts
223
0644
edit
dl
rm
internal-utils.js
1127
0644
edit
dl
rm
internal-utils.js.map
1347
0644
edit
dl
rm
load-components.d.ts
2988
0644
edit
dl
rm
load-components.js
7016
0644
edit
dl
rm
load-components.js.map
13170
0644
edit
dl
rm
load-default-error-components.d.ts
1352
0644
edit
dl
rm
load-default-error-components.js
1887
0644
edit
dl
rm
load-default-error-components.js.map
3826
0644
edit
dl
rm
load-manifest.external.d.ts
1808
0644
edit
dl
rm
load-manifest.external.js
3051
0644
edit
dl
rm
load-manifest.external.js.map
5827
0644
edit
dl
rm
match-bundle.d.ts
82
0644
edit
dl
rm
match-bundle.js
686
0644
edit
dl
rm
match-bundle.js.map
718
0644
edit
dl
rm
next-server.d.ts
11448
0644
edit
dl
rm
next-server.js
69844
0644
edit
dl
rm
next-server.js.map
110019
0644
edit
dl
rm
next-typescript.d.ts
47
0644
edit
dl
rm
next-typescript.js
318
0644
edit
dl
rm
next-typescript.js.map
222
0644
edit
dl
rm
next.d.ts
3646
0644
edit
dl
rm
next.js
15707
0644
edit
dl
rm
next.js.map
26816
0644
edit
dl
rm
node-environment-baseline.d.ts
0
0644
edit
dl
rm
node-environment-baseline.js
890
0644
edit
dl
rm
node-environment-baseline.js.map
1555
0644
edit
dl
rm
node-environment.d.ts
287
0644
edit
dl
rm
node-environment.js
648
0644
edit
dl
rm
node-environment.js.map
1065
0644
edit
dl
rm
node-polyfill-crypto.d.ts
0
0644
edit
dl
rm
node-polyfill-crypto.js
558
0644
edit
dl
rm
node-polyfill-crypto.js.map
1014
0644
edit
dl
rm
optimize-amp.d.ts
78
0644
edit
dl
rm
optimize-amp.js
549
0644
edit
dl
rm
optimize-amp.js.map
839
0644
edit
dl
rm
patch-error-inspect.d.ts
467
0644
edit
dl
rm
patch-error-inspect.js
19653
0644
edit
dl
rm
patch-error-inspect.js.map
28501
0644
edit
dl
rm
pipe-readable.d.ts
291
0644
edit
dl
rm
pipe-readable.js
5598
0644
edit
dl
rm
pipe-readable.js.map
7677
0644
edit
dl
rm
post-process.d.ts
372
0644
edit
dl
rm
post-process.js
2006
0644
edit
dl
rm
post-process.js.map
3983
0644
edit
dl
rm
ReactDOMServerPages.d.ts
38
0644
edit
dl
rm
ReactDOMServerPages.js
598
0644
edit
dl
rm
ReactDOMServerPages.js.map
957
0644
edit
dl
rm
render-result.d.ts
6241
0644
edit
dl
rm
render-result.js
7555
0644
edit
dl
rm
render-result.js.map
14243
0644
edit
dl
rm
render.d.ts
4887
0644
edit
dl
rm
render.js
55784
0644
edit
dl
rm
render.js.map
85056
0644
edit
dl
rm
request-meta.d.ts
8031
0644
edit
dl
rm
request-meta.js
1465
0644
edit
dl
rm
request-meta.js.map
9461
0644
edit
dl
rm
require-hook.d.ts
266
0644
edit
dl
rm
require-hook.js
2840
0644
edit
dl
rm
require-hook.js.map
4453
0644
edit
dl
rm
require.d.ts
377
0644
edit
dl
rm
require.js
3922
0644
edit
dl
rm
require.js.map
6048
0644
edit
dl
rm
revalidation-utils.d.ts
541
0644
edit
dl
rm
revalidation-utils.js
3341
0644
edit
dl
rm
revalidation-utils.js.map
5733
0644
edit
dl
rm
route-kind.d.ts
720
0644
edit
dl
rm
route-kind.js
1029
0644
edit
dl
rm
route-kind.js.map
937
0644
edit
dl
rm
send-payload.d.ts
597
0644
edit
dl
rm
send-payload.js
2849
0644
edit
dl
rm
send-payload.js.map
4214
0644
edit
dl
rm
send-response.d.ts
420
0644
edit
dl
rm
send-response.js
3065
0644
edit
dl
rm
send-response.js.map
4559
0644
edit
dl
rm
serve-static.d.ts
403
0644
edit
dl
rm
serve-static.js
2110
0644
edit
dl
rm
serve-static.js.map
2680
0644
edit
dl
rm
server-route-utils.d.ts
197
0644
edit
dl
rm
server-route-utils.js
1130
0644
edit
dl
rm
server-route-utils.js.map
1935
0644
edit
dl
rm
server-utils.d.ts
3134
0644
edit
dl
rm
server-utils.js
16542
0644
edit
dl
rm
server-utils.js.map
26064
0644
edit
dl
rm
setup-http-agent-env.d.ts
172
0644
edit
dl
rm
setup-http-agent-env.js
1050
0644
edit
dl
rm
setup-http-agent-env.js.map
1406
0644
edit
dl
rm
utils.d.ts
332
0644
edit
dl
rm
utils.js
3208
0644
edit
dl
rm
utils.js.map
4181
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/next/dist/server/server-utils.js
(16542B)
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); 0 && (module.exports = { getPreviouslyRevalidatedTags: null, getServerUtils: null, interpolateDynamicPath: null, normalizeCdnUrl: null, normalizeDynamicRouteParams: null }); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { getPreviouslyRevalidatedTags: function() { return getPreviouslyRevalidatedTags; }, getServerUtils: function() { return getServerUtils; }, interpolateDynamicPath: function() { return interpolateDynamicPath; }, normalizeCdnUrl: function() { return normalizeCdnUrl; }, normalizeDynamicRouteParams: function() { return normalizeDynamicRouteParams; } }); const _normalizelocalepath = require("../shared/lib/i18n/normalize-locale-path"); const _pathmatch = require("../shared/lib/router/utils/path-match"); const _routeregex = require("../shared/lib/router/utils/route-regex"); const _routematcher = require("../shared/lib/router/utils/route-matcher"); const _preparedestination = require("../shared/lib/router/utils/prepare-destination"); const _removetrailingslash = require("../shared/lib/router/utils/remove-trailing-slash"); const _apppaths = require("../shared/lib/router/utils/app-paths"); const _constants = require("../lib/constants"); const _utils = require("./web/utils"); const _decodequerypathparameter = require("./lib/decode-query-path-parameter"); const _url = require("../lib/url"); const _formaturl = require("../shared/lib/router/utils/format-url"); const _parseandvalidateflightrouterstate = require("./app-render/parse-and-validate-flight-router-state"); const _generateinterceptionroutesrewrites = require("../lib/generate-interception-routes-rewrites"); const _approuterheaders = require("../client/components/app-router-headers"); const _computechangedpath = require("../client/components/router-reducer/compute-changed-path"); function filterInternalQuery(query, paramKeys) { // this is used to pass query information in rewrites // but should not be exposed in final query delete query['nextInternalLocale']; for(const key in query){ const isNextQueryPrefix = key !== _constants.NEXT_QUERY_PARAM_PREFIX && key.startsWith(_constants.NEXT_QUERY_PARAM_PREFIX); const isNextInterceptionMarkerPrefix = key !== _constants.NEXT_INTERCEPTION_MARKER_PREFIX && key.startsWith(_constants.NEXT_INTERCEPTION_MARKER_PREFIX); if (isNextQueryPrefix || isNextInterceptionMarkerPrefix || paramKeys.includes(key)) { delete query[key]; } } } function normalizeCdnUrl(req, paramKeys) { // make sure to normalize req.url from CDNs to strip dynamic and rewrite // params from the query which are added during routing const _parsedUrl = (0, _url.parseReqUrl)(req.url); // we can't normalize if we can't parse if (!_parsedUrl) { return req.url; } delete _parsedUrl.search; filterInternalQuery(_parsedUrl.query, paramKeys); req.url = (0, _formaturl.formatUrl)(_parsedUrl); } function interpolateDynamicPath(pathname, params, defaultRouteRegex) { if (!defaultRouteRegex) return pathname; for (const param of Object.keys(defaultRouteRegex.groups)){ const { optional, repeat } = defaultRouteRegex.groups[param]; let builtParam = `[${repeat ? '...' : ''}${param}]`; if (optional) { builtParam = `[${builtParam}]`; } let paramValue; const value = params[param]; if (Array.isArray(value)) { paramValue = value.map((v)=>v && encodeURIComponent(v)).join('/'); } else if (value) { paramValue = encodeURIComponent(value); } else { paramValue = ''; } if (paramValue || optional) { pathname = pathname.replaceAll(builtParam, paramValue); } } return pathname; } function normalizeDynamicRouteParams(query, defaultRouteRegex, defaultRouteMatches, ignoreMissingOptional) { let hasValidParams = true; let params = {}; for (const key of Object.keys(defaultRouteRegex.groups)){ let value = query[key]; if (typeof value === 'string') { value = (0, _apppaths.normalizeRscURL)(value); } else if (Array.isArray(value)) { value = value.map(_apppaths.normalizeRscURL); } // if the value matches the default value we can't rely // on the parsed params, this is used to signal if we need // to parse x-now-route-matches or not const defaultValue = defaultRouteMatches[key]; const isOptional = defaultRouteRegex.groups[key].optional; const isDefaultValue = Array.isArray(defaultValue) ? defaultValue.some((defaultVal)=>{ return Array.isArray(value) ? value.some((val)=>val.includes(defaultVal)) : value == null ? void 0 : value.includes(defaultVal); }) : value == null ? void 0 : value.includes(defaultValue); if (isDefaultValue || typeof value === 'undefined' && !(isOptional && ignoreMissingOptional)) { return { params: {}, hasValidParams: false }; } // non-provided optional values should be undefined so normalize // them to undefined if (isOptional && (!value || Array.isArray(value) && value.length === 1 && // fallback optional catch-all SSG pages have // [[...paramName]] for the root path on Vercel (value[0] === 'index' || value[0] === `[[...${key}]]`))) { value = undefined; delete query[key]; } // query values from the proxy aren't already split into arrays // so make sure to normalize catch-all values if (value && typeof value === 'string' && defaultRouteRegex.groups[key].repeat) { value = value.split('/'); } if (value) { params[key] = value; } } return { params, hasValidParams }; } function getServerUtils({ page, i18n, basePath, rewrites, pageIsDynamic, trailingSlash, caseSensitive }) { let defaultRouteRegex; let dynamicRouteMatcher; let defaultRouteMatches; if (pageIsDynamic) { defaultRouteRegex = (0, _routeregex.getNamedRouteRegex)(page, { prefixRouteKeys: false }); dynamicRouteMatcher = (0, _routematcher.getRouteMatcher)(defaultRouteRegex); defaultRouteMatches = dynamicRouteMatcher(page); } function handleRewrites(req, parsedUrl) { const rewriteParams = {}; let fsPathname = parsedUrl.pathname; const matchesPage = ()=>{ const fsPathnameNoSlash = (0, _removetrailingslash.removeTrailingSlash)(fsPathname || ''); return fsPathnameNoSlash === (0, _removetrailingslash.removeTrailingSlash)(page) || (dynamicRouteMatcher == null ? void 0 : dynamicRouteMatcher(fsPathnameNoSlash)); }; const checkRewrite = (rewrite)=>{ const matcher = (0, _pathmatch.getPathMatch)(rewrite.source + (trailingSlash ? '(/)?' : ''), { removeUnnamedParams: true, strict: true, sensitive: !!caseSensitive }); if (!parsedUrl.pathname) return false; let params = matcher(parsedUrl.pathname); if ((rewrite.has || rewrite.missing) && params) { const hasParams = (0, _preparedestination.matchHas)(req, parsedUrl.query, rewrite.has, rewrite.missing); if (hasParams) { Object.assign(params, hasParams); } else { params = false; } } if (params) { try { // An interception rewrite might reference a dynamic param for a route the user // is currently on, which wouldn't be extractable from the matched route params. // This attempts to extract the dynamic params from the provided router state. if ((0, _generateinterceptionroutesrewrites.isInterceptionRouteRewrite)(rewrite)) { const stateHeader = req.headers[_approuterheaders.NEXT_ROUTER_STATE_TREE_HEADER]; if (stateHeader) { params = { ...(0, _computechangedpath.getSelectedParams)((0, _parseandvalidateflightrouterstate.parseAndValidateFlightRouterState)(stateHeader)), ...params }; } } } catch (err) { // this is a no-op -- we couldn't extract dynamic params from the provided router state, // so we'll just use the params from the route matcher } const { parsedDestination, destQuery } = (0, _preparedestination.prepareDestination)({ appendParamsToQuery: true, destination: rewrite.destination, params: params, query: parsedUrl.query }); // if the rewrite destination is external break rewrite chain if (parsedDestination.protocol) { return true; } Object.assign(rewriteParams, destQuery, params); Object.assign(parsedUrl.query, parsedDestination.query); delete parsedDestination.query; // for each property in parsedUrl.query, if the value is parametrized (eg :foo), look up the value // in rewriteParams and replace the parametrized value with the actual value // this is used when the rewrite destination does not contain the original source param // and so the value is still parametrized and needs to be replaced with the actual rewrite param Object.entries(parsedUrl.query).forEach(([key, value])=>{ if (value && typeof value === 'string' && value.startsWith(':')) { const paramName = value.slice(1); const actualValue = rewriteParams[paramName]; if (actualValue) { parsedUrl.query[key] = actualValue; } } }); Object.assign(parsedUrl, parsedDestination); fsPathname = parsedUrl.pathname; if (!fsPathname) return false; if (basePath) { fsPathname = fsPathname.replace(new RegExp(`^${basePath}`), '') || '/'; } if (i18n) { const result = (0, _normalizelocalepath.normalizeLocalePath)(fsPathname, i18n.locales); fsPathname = result.pathname; parsedUrl.query.nextInternalLocale = result.detectedLocale || params.nextInternalLocale; } if (fsPathname === page) { return true; } if (pageIsDynamic && dynamicRouteMatcher) { const dynamicParams = dynamicRouteMatcher(fsPathname); if (dynamicParams) { parsedUrl.query = { ...parsedUrl.query, ...dynamicParams }; return true; } } } return false; }; for (const rewrite of rewrites.beforeFiles || []){ checkRewrite(rewrite); } if (fsPathname !== page) { let finished = false; for (const rewrite of rewrites.afterFiles || []){ finished = checkRewrite(rewrite); if (finished) break; } if (!finished && !matchesPage()) { for (const rewrite of rewrites.fallback || []){ finished = checkRewrite(rewrite); if (finished) break; } } } return rewriteParams; } function getParamsFromRouteMatches(routeMatchesHeader) { // If we don't have a default route regex, we can't get params from route // matches if (!defaultRouteRegex) return null; const { groups, routeKeys } = defaultRouteRegex; const matcher = (0, _routematcher.getRouteMatcher)({ re: { // Simulate a RegExp match from the \`req.url\` input exec: (str)=>{ // Normalize all the prefixed query params. const obj = Object.fromEntries(new URLSearchParams(str)); for (const [key, value] of Object.entries(obj)){ const normalizedKey = (0, _utils.normalizeNextQueryParam)(key); if (!normalizedKey) continue; obj[normalizedKey] = value; delete obj[key]; } // Use all the named route keys. const result = {}; for (const keyName of Object.keys(routeKeys)){ const paramName = routeKeys[keyName]; // If this param name is not a valid parameter name, then skip it. if (!paramName) continue; const group = groups[paramName]; const value = obj[keyName]; // When we're missing a required param, we can't match the route. if (!group.optional && !value) return null; result[group.pos] = value; } return result; } }, groups }); const routeMatches = matcher(routeMatchesHeader); if (!routeMatches) return null; return routeMatches; } function normalizeQueryParams(query, routeParamKeys) { // this is used to pass query information in rewrites // but should not be exposed in final query delete query['nextInternalLocale']; for (const [key, value] of Object.entries(query)){ const normalizedKey = (0, _utils.normalizeNextQueryParam)(key); if (!normalizedKey) continue; // Remove the prefixed key from the query params because we want // to consume it for the dynamic route matcher. delete query[key]; routeParamKeys.add(normalizedKey); if (typeof value === 'undefined') continue; query[normalizedKey] = Array.isArray(value) ? value.map((v)=>(0, _decodequerypathparameter.decodeQueryPathParameter)(v)) : (0, _decodequerypathparameter.decodeQueryPathParameter)(value); } } return { handleRewrites, defaultRouteRegex, dynamicRouteMatcher, defaultRouteMatches, normalizeQueryParams, getParamsFromRouteMatches, /** * Normalize dynamic route params. * * @param query - The query params to normalize. * @param ignoreMissingOptional - Whether to ignore missing optional params. * @returns The normalized params and whether they are valid. */ normalizeDynamicRouteParams: (query, ignoreMissingOptional)=>{ if (!defaultRouteRegex || !defaultRouteMatches) { return { params: {}, hasValidParams: false }; } return normalizeDynamicRouteParams(query, defaultRouteRegex, defaultRouteMatches, ignoreMissingOptional); }, normalizeCdnUrl: (req, paramKeys)=>normalizeCdnUrl(req, paramKeys), interpolateDynamicPath: (pathname, params)=>interpolateDynamicPath(pathname, params, defaultRouteRegex), filterInternalQuery: (query, paramKeys)=>filterInternalQuery(query, paramKeys) }; } function getPreviouslyRevalidatedTags(headers, previewModeId) { return typeof headers[_constants.NEXT_CACHE_REVALIDATED_TAGS_HEADER] === 'string' && headers[_constants.NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER] === previewModeId ? headers[_constants.NEXT_CACHE_REVALIDATED_TAGS_HEADER].split(',') : []; } //# sourceMappingURL=server-utils.js.map
Save
cmd:
run