2022-01-07 22:09:52 -05:00
|
|
|
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
|
2021-04-20 08:47:22 -04:00
|
|
|
|
|
|
|
// @ts-check
|
|
|
|
/// <reference path="../webidl/internal.d.ts" />
|
|
|
|
/// <reference path="../url/internal.d.ts" />
|
|
|
|
/// <reference path="../url/lib.deno_url.d.ts" />
|
|
|
|
/// <reference path="../web/internal.d.ts" />
|
2021-06-10 09:26:10 -04:00
|
|
|
/// <reference path="../web/lib.deno_web.d.ts" />
|
2021-04-20 08:47:22 -04:00
|
|
|
/// <reference path="./internal.d.ts" />
|
2021-06-14 07:51:02 -04:00
|
|
|
/// <reference path="../web/06_streams_types.d.ts" />
|
2021-04-20 08:47:22 -04:00
|
|
|
/// <reference path="./lib.deno_fetch.d.ts" />
|
|
|
|
/// <reference lib="esnext" />
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
((window) => {
|
|
|
|
const core = window.Deno.core;
|
|
|
|
const webidl = globalThis.__bootstrap.webidl;
|
|
|
|
const { parseUrlEncoded } = globalThis.__bootstrap.url;
|
2021-06-22 08:06:37 -04:00
|
|
|
const { parseFormData, formDataFromEntries, formDataToBlob } =
|
2021-04-20 08:47:22 -04:00
|
|
|
globalThis.__bootstrap.formData;
|
|
|
|
const mimesniff = globalThis.__bootstrap.mimesniff;
|
2021-06-23 10:00:23 -04:00
|
|
|
const { isReadableStreamDisturbed, errorReadableStream, createProxy } =
|
2021-06-06 09:37:17 -04:00
|
|
|
globalThis.__bootstrap.streams;
|
2021-07-06 05:32:59 -04:00
|
|
|
const {
|
2021-07-26 07:52:59 -04:00
|
|
|
ArrayBuffer,
|
2021-07-06 05:32:59 -04:00
|
|
|
ArrayBufferIsView,
|
|
|
|
ArrayPrototypePush,
|
|
|
|
ArrayPrototypeMap,
|
|
|
|
JSONParse,
|
|
|
|
ObjectDefineProperties,
|
|
|
|
PromiseResolve,
|
|
|
|
TypedArrayPrototypeSet,
|
|
|
|
TypedArrayPrototypeSlice,
|
|
|
|
TypeError,
|
|
|
|
Uint8Array,
|
|
|
|
} = window.__bootstrap.primordials;
|
2021-04-20 08:47:22 -04:00
|
|
|
|
2021-10-26 16:00:01 -04:00
|
|
|
/**
|
|
|
|
* @param {Uint8Array | string} chunk
|
|
|
|
* @returns {Uint8Array}
|
|
|
|
*/
|
|
|
|
function chunkToU8(chunk) {
|
|
|
|
return typeof chunk === "string" ? core.encode(chunk) : chunk;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {Uint8Array | string} chunk
|
|
|
|
* @returns {string}
|
|
|
|
*/
|
|
|
|
function chunkToString(chunk) {
|
|
|
|
return typeof chunk === "string" ? chunk : core.decode(chunk);
|
|
|
|
}
|
|
|
|
|
2021-04-20 08:47:22 -04:00
|
|
|
class InnerBody {
|
|
|
|
/**
|
2021-10-26 16:00:01 -04:00
|
|
|
* @param {ReadableStream<Uint8Array> | { body: Uint8Array | string, consumed: boolean }} stream
|
2021-04-20 08:47:22 -04:00
|
|
|
*/
|
|
|
|
constructor(stream) {
|
2021-10-26 16:00:01 -04:00
|
|
|
/** @type {ReadableStream<Uint8Array> | { body: Uint8Array | string, consumed: boolean }} */
|
2021-04-20 08:47:22 -04:00
|
|
|
this.streamOrStatic = stream ??
|
|
|
|
{ body: new Uint8Array(), consumed: false };
|
2021-10-26 16:00:01 -04:00
|
|
|
/** @type {null | Uint8Array | string | Blob | FormData} */
|
2021-09-26 14:40:16 -04:00
|
|
|
this.source = null;
|
|
|
|
/** @type {null | number} */
|
|
|
|
this.length = null;
|
2021-04-20 08:47:22 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
get stream() {
|
|
|
|
if (!(this.streamOrStatic instanceof ReadableStream)) {
|
|
|
|
const { body, consumed } = this.streamOrStatic;
|
|
|
|
if (consumed) {
|
2021-07-02 05:34:12 -04:00
|
|
|
this.streamOrStatic = new ReadableStream();
|
|
|
|
this.streamOrStatic.getReader();
|
|
|
|
} else {
|
|
|
|
this.streamOrStatic = new ReadableStream({
|
|
|
|
start(controller) {
|
2021-10-26 16:00:01 -04:00
|
|
|
controller.enqueue(chunkToU8(body));
|
2021-07-02 05:34:12 -04:00
|
|
|
controller.close();
|
|
|
|
},
|
|
|
|
});
|
2021-04-20 08:47:22 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return this.streamOrStatic;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* https://fetch.spec.whatwg.org/#body-unusable
|
|
|
|
* @returns {boolean}
|
|
|
|
*/
|
|
|
|
unusable() {
|
|
|
|
if (this.streamOrStatic instanceof ReadableStream) {
|
|
|
|
return this.streamOrStatic.locked ||
|
|
|
|
isReadableStreamDisturbed(this.streamOrStatic);
|
|
|
|
}
|
|
|
|
return this.streamOrStatic.consumed;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @returns {boolean}
|
|
|
|
*/
|
|
|
|
consumed() {
|
|
|
|
if (this.streamOrStatic instanceof ReadableStream) {
|
|
|
|
return isReadableStreamDisturbed(this.streamOrStatic);
|
|
|
|
}
|
|
|
|
return this.streamOrStatic.consumed;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* https://fetch.spec.whatwg.org/#concept-body-consume-body
|
|
|
|
* @returns {Promise<Uint8Array>}
|
|
|
|
*/
|
|
|
|
async consume() {
|
|
|
|
if (this.unusable()) throw new TypeError("Body already consumed.");
|
|
|
|
if (this.streamOrStatic instanceof ReadableStream) {
|
|
|
|
const reader = this.stream.getReader();
|
|
|
|
/** @type {Uint8Array[]} */
|
|
|
|
const chunks = [];
|
|
|
|
let totalLength = 0;
|
|
|
|
while (true) {
|
|
|
|
const { value: chunk, done } = await reader.read();
|
|
|
|
if (done) break;
|
2021-07-06 05:32:59 -04:00
|
|
|
ArrayPrototypePush(chunks, chunk);
|
2021-04-20 08:47:22 -04:00
|
|
|
totalLength += chunk.byteLength;
|
|
|
|
}
|
|
|
|
const finalBuffer = new Uint8Array(totalLength);
|
|
|
|
let i = 0;
|
|
|
|
for (const chunk of chunks) {
|
2021-07-06 05:32:59 -04:00
|
|
|
TypedArrayPrototypeSet(finalBuffer, chunk, i);
|
2021-04-20 08:47:22 -04:00
|
|
|
i += chunk.byteLength;
|
|
|
|
}
|
|
|
|
return finalBuffer;
|
|
|
|
} else {
|
|
|
|
this.streamOrStatic.consumed = true;
|
|
|
|
return this.streamOrStatic.body;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-06 09:37:17 -04:00
|
|
|
cancel(error) {
|
|
|
|
if (this.streamOrStatic instanceof ReadableStream) {
|
|
|
|
this.streamOrStatic.cancel(error);
|
|
|
|
} else {
|
|
|
|
this.streamOrStatic.consumed = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
error(error) {
|
|
|
|
if (this.streamOrStatic instanceof ReadableStream) {
|
|
|
|
errorReadableStream(this.streamOrStatic, error);
|
|
|
|
} else {
|
|
|
|
this.streamOrStatic.consumed = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-20 08:47:22 -04:00
|
|
|
/**
|
|
|
|
* @returns {InnerBody}
|
|
|
|
*/
|
|
|
|
clone() {
|
|
|
|
const [out1, out2] = this.stream.tee();
|
|
|
|
this.streamOrStatic = out1;
|
|
|
|
const second = new InnerBody(out2);
|
|
|
|
second.source = core.deserialize(core.serialize(this.source));
|
|
|
|
second.length = this.length;
|
|
|
|
return second;
|
|
|
|
}
|
2021-06-23 10:00:23 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @returns {InnerBody}
|
|
|
|
*/
|
|
|
|
createProxy() {
|
|
|
|
let proxyStreamOrStatic;
|
|
|
|
if (this.streamOrStatic instanceof ReadableStream) {
|
|
|
|
proxyStreamOrStatic = createProxy(this.streamOrStatic);
|
|
|
|
} else {
|
|
|
|
proxyStreamOrStatic = { ...this.streamOrStatic };
|
|
|
|
this.streamOrStatic.consumed = true;
|
|
|
|
}
|
|
|
|
const proxy = new InnerBody(proxyStreamOrStatic);
|
|
|
|
proxy.source = this.source;
|
|
|
|
proxy.length = this.length;
|
|
|
|
return proxy;
|
|
|
|
}
|
2021-04-20 08:47:22 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2021-04-28 10:08:51 -04:00
|
|
|
* @param {any} prototype
|
|
|
|
* @param {symbol} bodySymbol
|
|
|
|
* @param {symbol} mimeTypeSymbol
|
2021-04-20 08:47:22 -04:00
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
function mixinBody(prototype, bodySymbol, mimeTypeSymbol) {
|
|
|
|
function consumeBody(object) {
|
|
|
|
if (object[bodySymbol] !== null) {
|
|
|
|
return object[bodySymbol].consume();
|
|
|
|
}
|
2021-07-06 05:32:59 -04:00
|
|
|
return PromiseResolve(new Uint8Array());
|
2021-04-20 08:47:22 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/** @type {PropertyDescriptorMap} */
|
|
|
|
const mixin = {
|
|
|
|
body: {
|
|
|
|
/**
|
|
|
|
* @returns {ReadableStream<Uint8Array> | null}
|
|
|
|
*/
|
|
|
|
get() {
|
|
|
|
webidl.assertBranded(this, prototype);
|
|
|
|
if (this[bodySymbol] === null) {
|
|
|
|
return null;
|
|
|
|
} else {
|
|
|
|
return this[bodySymbol].stream;
|
|
|
|
}
|
|
|
|
},
|
2021-05-26 17:44:42 -04:00
|
|
|
configurable: true,
|
|
|
|
enumerable: true,
|
2021-04-20 08:47:22 -04:00
|
|
|
},
|
|
|
|
bodyUsed: {
|
|
|
|
/**
|
|
|
|
* @returns {boolean}
|
|
|
|
*/
|
|
|
|
get() {
|
|
|
|
webidl.assertBranded(this, prototype);
|
|
|
|
if (this[bodySymbol] !== null) {
|
|
|
|
return this[bodySymbol].consumed();
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
},
|
2021-05-26 17:44:42 -04:00
|
|
|
configurable: true,
|
|
|
|
enumerable: true,
|
2021-04-20 08:47:22 -04:00
|
|
|
},
|
|
|
|
arrayBuffer: {
|
|
|
|
/** @returns {Promise<ArrayBuffer>} */
|
|
|
|
value: async function arrayBuffer() {
|
|
|
|
webidl.assertBranded(this, prototype);
|
|
|
|
const body = await consumeBody(this);
|
|
|
|
return packageData(body, "ArrayBuffer");
|
|
|
|
},
|
2021-05-26 17:44:42 -04:00
|
|
|
writable: true,
|
|
|
|
configurable: true,
|
|
|
|
enumerable: true,
|
2021-04-20 08:47:22 -04:00
|
|
|
},
|
|
|
|
blob: {
|
|
|
|
/** @returns {Promise<Blob>} */
|
|
|
|
value: async function blob() {
|
|
|
|
webidl.assertBranded(this, prototype);
|
|
|
|
const body = await consumeBody(this);
|
|
|
|
return packageData(body, "Blob", this[mimeTypeSymbol]);
|
|
|
|
},
|
2021-05-26 17:44:42 -04:00
|
|
|
writable: true,
|
|
|
|
configurable: true,
|
|
|
|
enumerable: true,
|
2021-04-20 08:47:22 -04:00
|
|
|
},
|
|
|
|
formData: {
|
|
|
|
/** @returns {Promise<FormData>} */
|
|
|
|
value: async function formData() {
|
|
|
|
webidl.assertBranded(this, prototype);
|
|
|
|
const body = await consumeBody(this);
|
|
|
|
return packageData(body, "FormData", this[mimeTypeSymbol]);
|
|
|
|
},
|
2021-05-26 17:44:42 -04:00
|
|
|
writable: true,
|
|
|
|
configurable: true,
|
|
|
|
enumerable: true,
|
2021-04-20 08:47:22 -04:00
|
|
|
},
|
|
|
|
json: {
|
|
|
|
/** @returns {Promise<any>} */
|
|
|
|
value: async function json() {
|
|
|
|
webidl.assertBranded(this, prototype);
|
|
|
|
const body = await consumeBody(this);
|
|
|
|
return packageData(body, "JSON");
|
|
|
|
},
|
2021-05-26 17:44:42 -04:00
|
|
|
writable: true,
|
|
|
|
configurable: true,
|
|
|
|
enumerable: true,
|
2021-04-20 08:47:22 -04:00
|
|
|
},
|
|
|
|
text: {
|
|
|
|
/** @returns {Promise<string>} */
|
|
|
|
value: async function text() {
|
|
|
|
webidl.assertBranded(this, prototype);
|
|
|
|
const body = await consumeBody(this);
|
|
|
|
return packageData(body, "text");
|
|
|
|
},
|
2021-05-26 17:44:42 -04:00
|
|
|
writable: true,
|
|
|
|
configurable: true,
|
|
|
|
enumerable: true,
|
2021-04-20 08:47:22 -04:00
|
|
|
},
|
|
|
|
};
|
2021-07-06 05:32:59 -04:00
|
|
|
return ObjectDefineProperties(prototype.prototype, mixin);
|
2021-04-20 08:47:22 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* https://fetch.spec.whatwg.org/#concept-body-package-data
|
2021-10-26 16:00:01 -04:00
|
|
|
* @param {Uint8Array | string} bytes
|
2021-04-20 08:47:22 -04:00
|
|
|
* @param {"ArrayBuffer" | "Blob" | "FormData" | "JSON" | "text"} type
|
|
|
|
* @param {MimeType | null} [mimeType]
|
|
|
|
*/
|
|
|
|
function packageData(bytes, type, mimeType) {
|
|
|
|
switch (type) {
|
|
|
|
case "ArrayBuffer":
|
2021-10-26 16:00:01 -04:00
|
|
|
return chunkToU8(bytes).buffer;
|
2021-04-20 08:47:22 -04:00
|
|
|
case "Blob":
|
|
|
|
return new Blob([bytes], {
|
|
|
|
type: mimeType !== null ? mimesniff.serializeMimeType(mimeType) : "",
|
|
|
|
});
|
|
|
|
case "FormData": {
|
|
|
|
if (mimeType !== null) {
|
2021-07-19 18:11:50 -04:00
|
|
|
const essence = mimesniff.essence(mimeType);
|
|
|
|
if (essence === "multipart/form-data") {
|
|
|
|
const boundary = mimeType.parameters.get("boundary");
|
|
|
|
if (boundary === null) {
|
|
|
|
throw new TypeError(
|
|
|
|
"Missing boundary parameter in mime type of multipart formdata.",
|
2021-04-20 08:47:22 -04:00
|
|
|
);
|
|
|
|
}
|
2021-10-26 16:00:01 -04:00
|
|
|
return parseFormData(chunkToU8(bytes), boundary);
|
2021-07-19 18:11:50 -04:00
|
|
|
} else if (essence === "application/x-www-form-urlencoded") {
|
2021-10-26 16:00:01 -04:00
|
|
|
// TODO(@AaronO): pass as-is with StringOrBuffer in op-layer
|
|
|
|
const entries = parseUrlEncoded(chunkToU8(bytes));
|
2021-07-19 18:11:50 -04:00
|
|
|
return formDataFromEntries(
|
|
|
|
ArrayPrototypeMap(
|
|
|
|
entries,
|
|
|
|
(x) => ({ name: x[0], value: x[1] }),
|
|
|
|
),
|
|
|
|
);
|
2021-04-20 08:47:22 -04:00
|
|
|
}
|
2021-07-19 18:11:50 -04:00
|
|
|
throw new TypeError("Body can not be decoded as form data");
|
2021-04-20 08:47:22 -04:00
|
|
|
}
|
|
|
|
throw new TypeError("Missing content type");
|
|
|
|
}
|
|
|
|
case "JSON":
|
2021-10-26 16:00:01 -04:00
|
|
|
return JSONParse(chunkToString(bytes));
|
2021-04-20 08:47:22 -04:00
|
|
|
case "text":
|
2021-10-26 16:00:01 -04:00
|
|
|
return chunkToString(bytes);
|
2021-04-20 08:47:22 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {BodyInit} object
|
|
|
|
* @returns {{body: InnerBody, contentType: string | null}}
|
|
|
|
*/
|
|
|
|
function extractBody(object) {
|
2021-10-26 16:00:01 -04:00
|
|
|
/** @type {ReadableStream<Uint8Array> | { body: Uint8Array | string, consumed: boolean }} */
|
2021-04-20 08:47:22 -04:00
|
|
|
let stream;
|
|
|
|
let source = null;
|
|
|
|
let length = null;
|
|
|
|
let contentType = null;
|
|
|
|
if (object instanceof Blob) {
|
|
|
|
stream = object.stream();
|
|
|
|
source = object;
|
|
|
|
length = object.size;
|
|
|
|
if (object.type.length !== 0) {
|
|
|
|
contentType = object.type;
|
|
|
|
}
|
2021-10-07 16:57:17 -04:00
|
|
|
} else if (object instanceof Uint8Array) {
|
|
|
|
// Fast(er) path for common case of Uint8Array
|
|
|
|
const copy = TypedArrayPrototypeSlice(object, 0, object.byteLength);
|
|
|
|
source = copy;
|
2021-07-06 05:32:59 -04:00
|
|
|
} else if (ArrayBufferIsView(object) || object instanceof ArrayBuffer) {
|
|
|
|
const u8 = ArrayBufferIsView(object)
|
2021-04-20 08:47:22 -04:00
|
|
|
? new Uint8Array(
|
|
|
|
object.buffer,
|
|
|
|
object.byteOffset,
|
|
|
|
object.byteLength,
|
|
|
|
)
|
|
|
|
: new Uint8Array(object);
|
2021-07-06 05:32:59 -04:00
|
|
|
const copy = TypedArrayPrototypeSlice(u8, 0, u8.byteLength);
|
2021-04-20 08:47:22 -04:00
|
|
|
source = copy;
|
|
|
|
} else if (object instanceof FormData) {
|
2021-06-22 08:06:37 -04:00
|
|
|
const res = formDataToBlob(object);
|
|
|
|
stream = res.stream();
|
|
|
|
source = res;
|
|
|
|
length = res.size;
|
|
|
|
contentType = res.type;
|
2021-04-20 08:47:22 -04:00
|
|
|
} else if (object instanceof URLSearchParams) {
|
2021-07-06 05:32:59 -04:00
|
|
|
// TODO(@satyarohith): not sure what primordial here.
|
2021-10-26 16:00:01 -04:00
|
|
|
source = object.toString();
|
2021-04-20 08:47:22 -04:00
|
|
|
contentType = "application/x-www-form-urlencoded;charset=UTF-8";
|
|
|
|
} else if (typeof object === "string") {
|
2021-10-26 16:00:01 -04:00
|
|
|
source = object;
|
2021-04-20 08:47:22 -04:00
|
|
|
contentType = "text/plain;charset=UTF-8";
|
|
|
|
} else if (object instanceof ReadableStream) {
|
|
|
|
stream = object;
|
|
|
|
if (object.locked || isReadableStreamDisturbed(object)) {
|
|
|
|
throw new TypeError("ReadableStream is locked or disturbed");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (source instanceof Uint8Array) {
|
|
|
|
stream = { body: source, consumed: false };
|
|
|
|
length = source.byteLength;
|
2021-10-26 16:00:01 -04:00
|
|
|
} else if (typeof source === "string") {
|
|
|
|
// WARNING: this deviates from spec (expects length to be set)
|
|
|
|
// https://fetch.spec.whatwg.org/#bodyinit > 7.
|
|
|
|
// no observable side-effect for users so far, but could change
|
|
|
|
stream = { body: source, consumed: false };
|
|
|
|
length = null; // NOTE: string length != byte length
|
2021-04-20 08:47:22 -04:00
|
|
|
}
|
|
|
|
const body = new InnerBody(stream);
|
|
|
|
body.source = source;
|
|
|
|
body.length = length;
|
|
|
|
return { body, contentType };
|
|
|
|
}
|
|
|
|
|
2021-09-25 09:30:31 -04:00
|
|
|
webidl.converters["BodyInit_DOMString"] = (V, opts) => {
|
2021-04-20 08:47:22 -04:00
|
|
|
// Union for (ReadableStream or Blob or ArrayBufferView or ArrayBuffer or FormData or URLSearchParams or USVString)
|
|
|
|
if (V instanceof ReadableStream) {
|
|
|
|
// TODO(lucacasonato): ReadableStream is not branded
|
|
|
|
return V;
|
|
|
|
} else if (V instanceof Blob) {
|
|
|
|
return webidl.converters["Blob"](V, opts);
|
|
|
|
} else if (V instanceof FormData) {
|
|
|
|
return webidl.converters["FormData"](V, opts);
|
|
|
|
} else if (V instanceof URLSearchParams) {
|
|
|
|
// TODO(lucacasonato): URLSearchParams is not branded
|
|
|
|
return V;
|
|
|
|
}
|
|
|
|
if (typeof V === "object") {
|
|
|
|
if (V instanceof ArrayBuffer || V instanceof SharedArrayBuffer) {
|
|
|
|
return webidl.converters["ArrayBuffer"](V, opts);
|
|
|
|
}
|
2021-07-06 05:32:59 -04:00
|
|
|
if (ArrayBufferIsView(V)) {
|
2021-04-20 08:47:22 -04:00
|
|
|
return webidl.converters["ArrayBufferView"](V, opts);
|
|
|
|
}
|
|
|
|
}
|
2021-09-25 09:30:31 -04:00
|
|
|
// BodyInit conversion is passed to extractBody(), which calls core.encode().
|
|
|
|
// core.encode() will UTF-8 encode strings with replacement, being equivalent to the USV normalization.
|
|
|
|
// Therefore we can convert to DOMString instead of USVString and avoid a costly redundant conversion.
|
|
|
|
return webidl.converters["DOMString"](V, opts);
|
2021-04-20 08:47:22 -04:00
|
|
|
};
|
2021-09-25 09:30:31 -04:00
|
|
|
webidl.converters["BodyInit_DOMString?"] = webidl.createNullableConverter(
|
|
|
|
webidl.converters["BodyInit_DOMString"],
|
2021-04-20 08:47:22 -04:00
|
|
|
);
|
|
|
|
|
|
|
|
window.__bootstrap.fetchBody = { mixinBody, InnerBody, extractBody };
|
|
|
|
})(globalThis);
|