/home/techb158/balavpn.abdallabala.com/node_modules/next/dist/esm/server
NameSizeModeActions
after/-0777rm
api-utils/-0777rm
app-render/-0777rm
async-storage/-0777rm
base-http/-0777rm
dev/-0777rm
instrumentation/-0777rm
lib/-0777rm
node-environment-extensions/-0777rm
normalizers/-0777rm
og/-0777rm
request/-0777rm
response-cache/-0777rm
resume-data-cache/-0777rm
route-definitions/-0777rm
route-matcher-managers/-0777rm
route-matcher-providers/-0777rm
route-matchers/-0777rm
route-matches/-0777rm
route-modules/-0777rm
stream-utils/-0777rm
typescript/-0777rm
use-cache/-0777rm
web/-0777rm
accept-header.js38520666editdlrm
accept-header.js.map64540666editdlrm
base-server.js971990666editdlrm
base-server.js.map1631740666editdlrm
body-streams.js29790666editdlrm
body-streams.js.map54080666editdlrm
cache-dir.js3240666editdlrm
cache-dir.js.map6980666editdlrm
ci-info.js6560666editdlrm
ci-info.js.map13170666editdlrm
client-component-renderer-logger.js17390666editdlrm
client-component-renderer-logger.js.map29840666editdlrm
config-schema.js273500666editdlrm
config-schema.js.map541600666editdlrm
config-shared.js66020666editdlrm
config-shared.js.map580730666editdlrm
config-utils.js56760666editdlrm
config-utils.js.map65820666editdlrm
config.js714880666editdlrm
config.js.map996810666editdlrm
create-deduped-by-callsite-server-error-logger.js23300666editdlrm
create-deduped-by-callsite-server-error-logger.js.map36410666editdlrm
crypto-utils.js23300666editdlrm
crypto-utils.js.map42990666editdlrm
dynamic-rendering-utils.js29840666editdlrm
dynamic-rendering-utils.js.map48830666editdlrm
font-utils.js15540666editdlrm
font-utils.js.map30730666editdlrm
get-app-route-from-entrypoint.js4520666editdlrm
get-app-route-from-entrypoint.js.map8520666editdlrm
get-page-files.js5470666editdlrm
get-page-files.js.map16990666editdlrm
get-route-from-entrypoint.js7940666editdlrm
get-route-from-entrypoint.js.map13980666editdlrm
image-optimizer.js344020666editdlrm
image-optimizer.js.map565180666editdlrm
internal-utils.js5780666editdlrm
internal-utils.js.map13080666editdlrm
load-components.js62050666editdlrm
load-components.js.map131850666editdlrm
load-default-error-components.js15560666editdlrm
load-default-error-components.js.map38870666editdlrm
load-manifest.external.js23080666editdlrm
load-manifest.external.js.map57630666editdlrm
match-bundle.js3200666editdlrm
match-bundle.js.map7050666editdlrm
next-server.js656030666editdlrm
next-server.js.map1104480666editdlrm
next-typescript.js910666editdlrm
next-typescript.js.map2150666editdlrm
next.js135400666editdlrm
next.js.map269300666editdlrm
node-environment-baseline.js8760666editdlrm
node-environment-baseline.js.map15540666editdlrm
node-environment.js7570666editdlrm
node-environment.js.map11650666editdlrm
node-polyfill-crypto.js5440666editdlrm
node-polyfill-crypto.js.map10130666editdlrm
optimize-amp.js3600666editdlrm
optimize-amp.js.map8230666editdlrm
patch-error-inspect.js175330666editdlrm
patch-error-inspect.js.map285930666editdlrm
pipe-readable.js50210666editdlrm
pipe-readable.js.map77020666editdlrm
post-process.js18000666editdlrm
post-process.js.map39970666editdlrm
ReactDOMServerPages.d.ts380666editdlrm
ReactDOMServerPages.js5840666editdlrm
ReactDOMServerPages.js.map9560666editdlrm
render-result.js72040666editdlrm
render-result.js.map142390666editdlrm
render.js534870666editdlrm
render.js.map854420666editdlrm
request-meta.js13410666editdlrm
request-meta.js.map94330666editdlrm
require-hook.js22770666editdlrm
require-hook.js.map43970666editdlrm
require.js30420666editdlrm
require.js.map61070666editdlrm
revalidation-utils.js29170666editdlrm
revalidation-utils.js.map57080666editdlrm
route-kind.js8290666editdlrm
route-kind.js.map9270666editdlrm
send-payload.js21740666editdlrm
send-payload.js.map42120666editdlrm
send-response.js30400666editdlrm
send-response.js.map45980666editdlrm
serve-static.js13340666editdlrm
serve-static.js.map26030666editdlrm
server-route-utils.js10610666editdlrm
server-route-utils.js.map19990666editdlrm
server-utils.js153150666editdlrm
server-utils.js.map261390666editdlrm
setup-http-agent-env.js8320666editdlrm
setup-http-agent-env.js.map14390666editdlrm
utils.js26720666editdlrm
utils.js.map41390666editdlrm
Edit: /home/techb158/balavpn.abdallabala.com/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