/
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
(7204B)
import { chainStreams, streamFromBuffer, streamFromString, streamToString } from './stream-utils/node-web-streams-helper'; import { isAbortError, pipeToNodeResponse } from './pipe-readable'; import { InvariantError } from '../shared/lib/invariant-error'; export default class RenderResult { static #_ = /** * A render result that represents an empty response. This is used to * represent a response that was not found or was already sent. */ this.EMPTY = new RenderResult(null, { metadata: {}, contentType: null }); /** * Creates a new RenderResult instance from a static response. * * @param value the static response value * @param contentType the content type of the response * @returns a new RenderResult instance */ static fromStatic(value, contentType) { return new RenderResult(value, { metadata: {}, contentType }); } constructor(response, { contentType, waitUntil, metadata }){ this.response = response; this.contentType = contentType; this.metadata = metadata; this.waitUntil = waitUntil; } assignMetadata(metadata) { Object.assign(this.metadata, metadata); } /** * Returns true if the response is null. It can be null if the response was * not found or was already sent. */ get isNull() { return this.response === null; } /** * Returns false if the response is a string. It can be a string if the page * was prerendered. If it's not, then it was generated dynamically. */ get isDynamic() { return typeof this.response !== 'string'; } toUnchunkedString(stream = false) { if (this.response === null) { // If the response is null, return an empty string. This behavior is // intentional as we're now providing the `RenderResult.EMPTY` value. return ''; } if (typeof this.response !== 'string') { if (!stream) { throw Object.defineProperty(new InvariantError('dynamic responses cannot be unchunked. This is a bug in Next.js'), "__NEXT_ERROR_CODE", { value: "E732", enumerable: false, configurable: true }); } return streamToString(this.readable); } return this.response; } /** * Returns a readable stream of the response. */ get readable() { if (this.response === null) { // If the response is null, return an empty stream. This behavior is // intentional as we're now providing the `RenderResult.EMPTY` value. return new ReadableStream({ start (controller) { controller.close(); } }); } if (typeof this.response === 'string') { return streamFromString(this.response); } if (Buffer.isBuffer(this.response)) { return streamFromBuffer(this.response); } // If the response is an array of streams, then chain them together. if (Array.isArray(this.response)) { return chainStreams(...this.response); } return this.response; } /** * Coerces the response to an array of streams. This will convert the response * to an array of streams if it is not already one. * * @returns An array of streams */ coerce() { if (this.response === null) { // If the response is null, return an empty stream. This behavior is // intentional as we're now providing the `RenderResult.EMPTY` value. return []; } if (typeof this.response === 'string') { return [ streamFromString(this.response) ]; } else if (Array.isArray(this.response)) { return this.response; } else if (Buffer.isBuffer(this.response)) { return [ streamFromBuffer(this.response) ]; } else { return [ this.response ]; } } /** * Unshifts a new stream to the response. This will convert the response to an * array of streams if it is not already one and will add the new stream to * the start of the array. When this response is piped, all of the streams * will be piped one after the other. * * @param readable The new stream to unshift */ unshift(readable) { // Coerce the response to an array of streams. this.response = this.coerce(); // Add the new stream to the start of the array. this.response.unshift(readable); } /** * Chains a new stream to the response. This will convert the response to an * array of streams if it is not already one and will add the new stream to * the end. When this response is piped, all of the streams will be piped * one after the other. * * @param readable The new stream to chain */ push(readable) { // Coerce the response to an array of streams. this.response = this.coerce(); // Add the new stream to the end of the array. this.response.push(readable); } /** * Pipes the response to a writable stream. This will close/cancel the * writable stream if an error is encountered. If this doesn't throw, then * the writable stream will be closed or aborted. * * @param writable Writable stream to pipe the response to */ async pipeTo(writable) { try { await this.readable.pipeTo(writable, { // We want to close the writable stream ourselves so that we can wait // for the waitUntil promise to resolve before closing it. If an error // is encountered, we'll abort the writable stream if we swallowed the // error. preventClose: true }); // If there is a waitUntil promise, wait for it to resolve before // closing the writable stream. if (this.waitUntil) await this.waitUntil; // Close the writable stream. await writable.close(); } catch (err) { // If this is an abort error, we should abort the writable stream (as we // took ownership of it when we started piping). We don't need to re-throw // because we handled the error. if (isAbortError(err)) { // Abort the writable stream if an error is encountered. await writable.abort(err); return; } // We're not aborting the writer here as when this method throws it's not // clear as to how so the caller should assume it's their responsibility // to clean up the writer. throw err; } } /** * Pipes the response to a node response. This will close/cancel the node * response if an error is encountered. * * @param res */ async pipeToNodeResponse(res) { await pipeToNodeResponse(this.readable, res, this.waitUntil); } } //# sourceMappingURL=render-result.js.map
Save
cmd:
run