/
opt
/
canhelp
/
node_modules
/
next
/
dist
/
esm
/
server
/
/opt/canhelp/node_modules/next/dist/esm/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.js
3852
0644
edit
dl
rm
accept-header.js.map
6454
0644
edit
dl
rm
base-server.js
96521
0644
edit
dl
rm
base-server.js.map
162133
0644
edit
dl
rm
body-streams.js
2979
0644
edit
dl
rm
body-streams.js.map
5408
0644
edit
dl
rm
cache-dir.js
324
0644
edit
dl
rm
cache-dir.js.map
698
0644
edit
dl
rm
ci-info.js
656
0644
edit
dl
rm
ci-info.js.map
1317
0644
edit
dl
rm
client-component-renderer-logger.js
1739
0644
edit
dl
rm
client-component-renderer-logger.js.map
2984
0644
edit
dl
rm
config-schema.js
27350
0644
edit
dl
rm
config-schema.js.map
54160
0644
edit
dl
rm
config-shared.js
6602
0644
edit
dl
rm
config-shared.js.map
58073
0644
edit
dl
rm
config-utils.js
5676
0644
edit
dl
rm
config-utils.js.map
6582
0644
edit
dl
rm
config.js
71488
0644
edit
dl
rm
config.js.map
99681
0644
edit
dl
rm
create-deduped-by-callsite-server-error-logger.js
2330
0644
edit
dl
rm
create-deduped-by-callsite-server-error-logger.js.map
3641
0644
edit
dl
rm
crypto-utils.js
2330
0644
edit
dl
rm
crypto-utils.js.map
4299
0644
edit
dl
rm
dynamic-rendering-utils.js
2984
0644
edit
dl
rm
dynamic-rendering-utils.js.map
4883
0644
edit
dl
rm
font-utils.js
1554
0644
edit
dl
rm
font-utils.js.map
3073
0644
edit
dl
rm
get-app-route-from-entrypoint.js
452
0644
edit
dl
rm
get-app-route-from-entrypoint.js.map
852
0644
edit
dl
rm
get-page-files.js
547
0644
edit
dl
rm
get-page-files.js.map
1699
0644
edit
dl
rm
get-route-from-entrypoint.js
794
0644
edit
dl
rm
get-route-from-entrypoint.js.map
1398
0644
edit
dl
rm
htmlescape.js
510
0644
edit
dl
rm
htmlescape.js.map
961
0644
edit
dl
rm
image-optimizer.js
33424
0644
edit
dl
rm
image-optimizer.js.map
55392
0644
edit
dl
rm
internal-utils.js
578
0644
edit
dl
rm
internal-utils.js.map
1308
0644
edit
dl
rm
load-components.js
6205
0644
edit
dl
rm
load-components.js.map
13185
0644
edit
dl
rm
load-default-error-components.js
1556
0644
edit
dl
rm
load-default-error-components.js.map
3887
0644
edit
dl
rm
load-manifest.external.js
2308
0644
edit
dl
rm
load-manifest.external.js.map
5763
0644
edit
dl
rm
match-bundle.js
320
0644
edit
dl
rm
match-bundle.js.map
705
0644
edit
dl
rm
next-server.js
65451
0644
edit
dl
rm
next-server.js.map
110145
0644
edit
dl
rm
next-typescript.js
91
0644
edit
dl
rm
next-typescript.js.map
215
0644
edit
dl
rm
next.js
13540
0644
edit
dl
rm
next.js.map
26930
0644
edit
dl
rm
node-environment-baseline.js
876
0644
edit
dl
rm
node-environment-baseline.js.map
1554
0644
edit
dl
rm
node-environment.js
757
0644
edit
dl
rm
node-environment.js.map
1165
0644
edit
dl
rm
node-polyfill-crypto.js
544
0644
edit
dl
rm
node-polyfill-crypto.js.map
1013
0644
edit
dl
rm
optimize-amp.js
360
0644
edit
dl
rm
optimize-amp.js.map
823
0644
edit
dl
rm
patch-error-inspect.js
17533
0644
edit
dl
rm
patch-error-inspect.js.map
28593
0644
edit
dl
rm
pipe-readable.js
5021
0644
edit
dl
rm
pipe-readable.js.map
7702
0644
edit
dl
rm
post-process.js
1800
0644
edit
dl
rm
post-process.js.map
3997
0644
edit
dl
rm
ReactDOMServerPages.d.ts
38
0644
edit
dl
rm
ReactDOMServerPages.js
584
0644
edit
dl
rm
ReactDOMServerPages.js.map
956
0644
edit
dl
rm
render-result.js
7204
0644
edit
dl
rm
render-result.js.map
14239
0644
edit
dl
rm
render.js
53487
0644
edit
dl
rm
render.js.map
85442
0644
edit
dl
rm
request-meta.js
1341
0644
edit
dl
rm
request-meta.js.map
9433
0644
edit
dl
rm
require-hook.js
2277
0644
edit
dl
rm
require-hook.js.map
4397
0644
edit
dl
rm
require.js
3042
0644
edit
dl
rm
require.js.map
6107
0644
edit
dl
rm
revalidation-utils.js
2917
0644
edit
dl
rm
revalidation-utils.js.map
5708
0644
edit
dl
rm
route-kind.js
829
0644
edit
dl
rm
route-kind.js.map
927
0644
edit
dl
rm
send-payload.js
2174
0644
edit
dl
rm
send-payload.js.map
4212
0644
edit
dl
rm
send-response.js
3040
0644
edit
dl
rm
send-response.js.map
4598
0644
edit
dl
rm
serve-static.js
1334
0644
edit
dl
rm
serve-static.js.map
2603
0644
edit
dl
rm
server-route-utils.js
1061
0644
edit
dl
rm
server-route-utils.js.map
1999
0644
edit
dl
rm
server-utils.js
15315
0644
edit
dl
rm
server-utils.js.map
26139
0644
edit
dl
rm
setup-http-agent-env.js
832
0644
edit
dl
rm
setup-http-agent-env.js.map
1439
0644
edit
dl
rm
utils.js
2672
0644
edit
dl
rm
utils.js.map
4139
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/next/dist/esm/server/render-result.js.map
(14239B)
{"version":3,"sources":["../../src/server/render-result.ts"],"sourcesContent":["import type { OutgoingHttpHeaders, ServerResponse } from 'http'\nimport type { CacheControl } from './lib/cache-control'\nimport type { FetchMetrics } from './base-http'\n\nimport {\n chainStreams,\n streamFromBuffer,\n streamFromString,\n streamToString,\n} from './stream-utils/node-web-streams-helper'\nimport { isAbortError, pipeToNodeResponse } from './pipe-readable'\nimport type { RenderResumeDataCache } from './resume-data-cache/resume-data-cache'\nimport { InvariantError } from '../shared/lib/invariant-error'\nimport type {\n HTML_CONTENT_TYPE_HEADER,\n JSON_CONTENT_TYPE_HEADER,\n TEXT_PLAIN_CONTENT_TYPE_HEADER,\n} from '../lib/constants'\nimport type { RSC_CONTENT_TYPE_HEADER } from '../client/components/app-router-headers'\n\ntype ContentTypeOption =\n | typeof RSC_CONTENT_TYPE_HEADER // For App Page RSC responses\n | typeof HTML_CONTENT_TYPE_HEADER // For App Page, Pages HTML responses\n | typeof JSON_CONTENT_TYPE_HEADER // For API routes, Next.js data requests\n | typeof TEXT_PLAIN_CONTENT_TYPE_HEADER // For simplified errors\n\nexport type AppPageRenderResultMetadata = {\n flightData?: Buffer\n cacheControl?: CacheControl\n staticBailoutInfo?: {\n stack?: string\n description?: string\n }\n\n /**\n * The postponed state if the render had postponed and needs to be resumed.\n */\n postponed?: string\n\n /**\n * The headers to set on the response that were added by the render.\n */\n headers?: OutgoingHttpHeaders\n statusCode?: number\n fetchTags?: string\n fetchMetrics?: FetchMetrics\n\n segmentData?: Map<string, Buffer>\n\n /**\n * In development, the resume data cache is warmed up before the render. This\n * is attached to the metadata so that it can be used during the render. When\n * prerendering, the filled resume data cache is also attached to the metadata\n * so that it can be used when prerendering matching fallback shells.\n */\n renderResumeDataCache?: RenderResumeDataCache\n}\n\nexport type PagesRenderResultMetadata = {\n pageData?: any\n cacheControl?: CacheControl\n assetQueryString?: string\n isNotFound?: boolean\n isRedirect?: boolean\n}\n\nexport type StaticRenderResultMetadata = {}\n\nexport type RenderResultMetadata = AppPageRenderResultMetadata &\n PagesRenderResultMetadata &\n StaticRenderResultMetadata\n\nexport type RenderResultResponse =\n | ReadableStream<Uint8Array>[]\n | ReadableStream<Uint8Array>\n | string\n | Buffer\n | null\n\nexport type RenderResultOptions<\n Metadata extends RenderResultMetadata = RenderResultMetadata,\n> = {\n contentType: ContentTypeOption | null\n waitUntil?: Promise<unknown>\n metadata: Metadata\n}\n\nexport default class RenderResult<\n Metadata extends RenderResultMetadata = RenderResultMetadata,\n> {\n /**\n * The detected content type for the response. This is used to set the\n * `Content-Type` header.\n */\n public readonly contentType: ContentTypeOption | null\n\n /**\n * The metadata for the response. This is used to set the revalidation times\n * and other metadata.\n */\n public readonly metadata: Readonly<Metadata>\n\n /**\n * The response itself. This can be a string, a stream, or null. If it's a\n * string, then it's a static response. If it's a stream, then it's a\n * dynamic response. If it's null, then the response was not found or was\n * already sent.\n */\n private response: RenderResultResponse\n\n /**\n * A render result that represents an empty response. This is used to\n * represent a response that was not found or was already sent.\n */\n public static readonly EMPTY = new RenderResult<StaticRenderResultMetadata>(\n null,\n { metadata: {}, contentType: null }\n )\n\n /**\n * Creates a new RenderResult instance from a static response.\n *\n * @param value the static response value\n * @param contentType the content type of the response\n * @returns a new RenderResult instance\n */\n public static fromStatic(\n value: string | Buffer,\n contentType: ContentTypeOption\n ) {\n return new RenderResult<StaticRenderResultMetadata>(value, {\n metadata: {},\n contentType,\n })\n }\n\n private readonly waitUntil?: Promise<unknown>\n\n constructor(\n response: RenderResultResponse,\n { contentType, waitUntil, metadata }: RenderResultOptions<Metadata>\n ) {\n this.response = response\n this.contentType = contentType\n this.metadata = metadata\n this.waitUntil = waitUntil\n }\n\n public assignMetadata(metadata: Metadata) {\n Object.assign(this.metadata, metadata)\n }\n\n /**\n * Returns true if the response is null. It can be null if the response was\n * not found or was already sent.\n */\n public get isNull(): boolean {\n return this.response === null\n }\n\n /**\n * Returns false if the response is a string. It can be a string if the page\n * was prerendered. If it's not, then it was generated dynamically.\n */\n public get isDynamic(): boolean {\n return typeof this.response !== 'string'\n }\n\n /**\n * Returns the response if it is a string. If the page was dynamic, this will\n * return a promise if the `stream` option is true, or it will throw an error.\n *\n * @param stream Whether or not to return a promise if the response is dynamic\n * @returns The response as a string\n */\n public toUnchunkedString(stream?: false): string\n public toUnchunkedString(stream: true): Promise<string>\n public toUnchunkedString(stream = false): Promise<string> | string {\n if (this.response === null) {\n // If the response is null, return an empty string. This behavior is\n // intentional as we're now providing the `RenderResult.EMPTY` value.\n return ''\n }\n\n if (typeof this.response !== 'string') {\n if (!stream) {\n throw new InvariantError(\n 'dynamic responses cannot be unchunked. This is a bug in Next.js'\n )\n }\n\n return streamToString(this.readable)\n }\n\n return this.response\n }\n\n /**\n * Returns a readable stream of the response.\n */\n private get readable(): ReadableStream<Uint8Array> {\n if (this.response === null) {\n // If the response is null, return an empty stream. This behavior is\n // intentional as we're now providing the `RenderResult.EMPTY` value.\n return new ReadableStream<Uint8Array>({\n start(controller) {\n controller.close()\n },\n })\n }\n\n if (typeof this.response === 'string') {\n return streamFromString(this.response)\n }\n\n if (Buffer.isBuffer(this.response)) {\n return streamFromBuffer(this.response)\n }\n\n // If the response is an array of streams, then chain them together.\n if (Array.isArray(this.response)) {\n return chainStreams(...this.response)\n }\n\n return this.response\n }\n\n /**\n * Coerces the response to an array of streams. This will convert the response\n * to an array of streams if it is not already one.\n *\n * @returns An array of streams\n */\n private coerce(): ReadableStream<Uint8Array>[] {\n if (this.response === null) {\n // If the response is null, return an empty stream. This behavior is\n // intentional as we're now providing the `RenderResult.EMPTY` value.\n return []\n }\n\n if (typeof this.response === 'string') {\n return [streamFromString(this.response)]\n } else if (Array.isArray(this.response)) {\n return this.response\n } else if (Buffer.isBuffer(this.response)) {\n return [streamFromBuffer(this.response)]\n } else {\n return [this.response]\n }\n }\n\n /**\n * Unshifts a new stream to the response. This will convert the response to an\n * array of streams if it is not already one and will add the new stream to\n * the start of the array. When this response is piped, all of the streams\n * will be piped one after the other.\n *\n * @param readable The new stream to unshift\n */\n public unshift(readable: ReadableStream<Uint8Array>): void {\n // Coerce the response to an array of streams.\n this.response = this.coerce()\n\n // Add the new stream to the start of the array.\n this.response.unshift(readable)\n }\n\n /**\n * Chains a new stream to the response. This will convert the response to an\n * array of streams if it is not already one and will add the new stream to\n * the end. When this response is piped, all of the streams will be piped\n * one after the other.\n *\n * @param readable The new stream to chain\n */\n public push(readable: ReadableStream<Uint8Array>): void {\n // Coerce the response to an array of streams.\n this.response = this.coerce()\n\n // Add the new stream to the end of the array.\n this.response.push(readable)\n }\n\n /**\n * Pipes the response to a writable stream. This will close/cancel the\n * writable stream if an error is encountered. If this doesn't throw, then\n * the writable stream will be closed or aborted.\n *\n * @param writable Writable stream to pipe the response to\n */\n public async pipeTo(writable: WritableStream<Uint8Array>): Promise<void> {\n try {\n await this.readable.pipeTo(writable, {\n // We want to close the writable stream ourselves so that we can wait\n // for the waitUntil promise to resolve before closing it. If an error\n // is encountered, we'll abort the writable stream if we swallowed the\n // error.\n preventClose: true,\n })\n\n // If there is a waitUntil promise, wait for it to resolve before\n // closing the writable stream.\n if (this.waitUntil) await this.waitUntil\n\n // Close the writable stream.\n await writable.close()\n } catch (err) {\n // If this is an abort error, we should abort the writable stream (as we\n // took ownership of it when we started piping). We don't need to re-throw\n // because we handled the error.\n if (isAbortError(err)) {\n // Abort the writable stream if an error is encountered.\n await writable.abort(err)\n\n return\n }\n\n // We're not aborting the writer here as when this method throws it's not\n // clear as to how so the caller should assume it's their responsibility\n // to clean up the writer.\n throw err\n }\n }\n\n /**\n * Pipes the response to a node response. This will close/cancel the node\n * response if an error is encountered.\n *\n * @param res\n */\n public async pipeToNodeResponse(res: ServerResponse) {\n await pipeToNodeResponse(this.readable, res, this.waitUntil)\n }\n}\n"],"names":["chainStreams","streamFromBuffer","streamFromString","streamToString","isAbortError","pipeToNodeResponse","InvariantError","RenderResult","EMPTY","metadata","contentType","fromStatic","value","constructor","response","waitUntil","assignMetadata","Object","assign","isNull","isDynamic","toUnchunkedString","stream","readable","ReadableStream","start","controller","close","Buffer","isBuffer","Array","isArray","coerce","unshift","push","pipeTo","writable","preventClose","err","abort","res"],"mappings":"AAIA,SACEA,YAAY,EACZC,gBAAgB,EAChBC,gBAAgB,EAChBC,cAAc,QACT,yCAAwC;AAC/C,SAASC,YAAY,EAAEC,kBAAkB,QAAQ,kBAAiB;AAElE,SAASC,cAAc,QAAQ,g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