@absolutejs/absolute 0.19.0-beta.375 → 0.19.0-beta.377
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular/browser.js +11 -13
- package/dist/angular/browser.js.map +4 -4
- package/dist/angular/index.js +56 -56
- package/dist/angular/index.js.map +5 -5
- package/dist/core/streamingSlotRegistrar.js +96 -0
- package/dist/core/streamingSlotRegistrar.js.map +10 -0
- package/dist/core/streamingSlotRegistry.js +140 -0
- package/dist/core/streamingSlotRegistry.js.map +11 -0
- package/dist/index.js +56 -56
- package/dist/index.js.map +5 -5
- package/dist/react/components/browser/index.js +10 -77
- package/dist/react/components/index.js +11 -11
- package/dist/react/components/index.js.map +4 -4
- package/dist/react/index.js +56 -56
- package/dist/react/index.js.map +5 -5
- package/dist/src/react/components/StreamSlot.browser.d.ts +10 -0
- package/dist/src/react/components/SuspenseSlot.browser.d.ts +22 -0
- package/dist/src/react/components/browser/index.d.ts +5 -0
- package/dist/src/svelte/browser.d.ts +0 -3
- package/dist/src/svelte/index.d.ts +0 -3
- package/dist/svelte/browser.js +2 -11
- package/dist/svelte/browser.js.map +3 -3
- package/dist/svelte/index.js +57 -66
- package/dist/svelte/index.js.map +6 -6
- package/dist/vue/components/index.js +7 -9
- package/dist/vue/components/index.js.map +4 -4
- package/dist/vue/index.js +52 -54
- package/dist/vue/index.js.map +5 -5
- package/package.json +5 -1
- package/dist/AwaitSlot-yd9jtwpr.svelte +0 -39
- package/dist/Island-hn6g4vxm.svelte +0 -71
- package/dist/StreamSlot-kyee4w0z.svelte +0 -35
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/
|
|
3
|
+
"sources": ["../src/core/streamingSlotRegistrar.ts", "../src/vue/components/SuspenseSlot.ts", "../src/vue/components/StreamSlot.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import {\n\tdefineComponent,\n\th,\n\ttype PropType,\n\ttype Slot,\n\ttype VNodeChild\n} from 'vue';\nimport { registerStreamingSlot } from '../../core/streamingSlotRegistrar';\n\nconst renderVueNodesToHtml = async (nodes: VNodeChild) => {\n\tconst { createSSRApp, h: createVNode } = await import('vue');\n\tconst { renderToString } = await import('vue/server-renderer');\n\n\tconst app = createSSRApp({\n\t\trender: () => createVNode('div', undefined, nodes ?? undefined)\n\t});\n\tconst html = await renderToString(app);\n\n\treturn html.replace(/^<div>|<\\/div>$/g, '');\n};\n\nconst hasFrameworkSlots = (\n\tdefaultSlot: Slot | undefined,\n\tfallbackSlot: Slot | undefined,\n\terrorSlot: Slot | undefined,\n\tpromise: Promise<unknown> | undefined\n) =>\n\tdefaultSlot !== undefined ||\n\tfallbackSlot !== undefined ||\n\terrorSlot !== undefined ||\n\tpromise !== undefined;\n\nexport const SuspenseSlot = defineComponent({\n\tname: 'AbsoluteSuspenseSlot',\n\tprops: {\n\t\tclassName: { default: undefined, type: String },\n\t\terrorHtml: { default: undefined, type: String },\n\t\tfallbackHtml: { default: '', type: String },\n\t\tid: { required: true, type: String },\n\t\tpromise: {\n\t\t\tdefault: undefined,\n\t\t\ttype: Object as PropType<Promise<unknown>>\n\t\t},\n\t\tresolve: {\n\t\t\tdefault: undefined,\n\t\t\ttype: Function as PropType<() => Promise<unknown> | unknown>\n\t\t},\n\t\ttimeoutMs: { default: undefined, type: Number }\n\t},\n\tsetup(props, { slots }) {\n\t\tconst usesFrameworkSlots = hasFrameworkSlots(\n\t\t\tslots.default,\n\t\t\tslots.fallback,\n\t\t\tslots.error,\n\t\t\tprops.promise\n\t\t);\n\n\t\tif (typeof window === 'undefined') {\n\t\t\tif (!usesFrameworkSlots && props.resolve) {\n\t\t\t\tregisterStreamingSlot({\n\t\t\t\t\terrorHtml: props.errorHtml,\n\t\t\t\t\tfallbackHtml: props.fallbackHtml,\n\t\t\t\t\tid: props.id,\n\t\t\t\t\tresolve: props.resolve as () => Promise<string> | string,\n\t\t\t\t\ttimeoutMs: props.timeoutMs\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tregisterStreamingSlot({\n\t\t\t\t\tid: props.id,\n\t\t\t\t\tresolve: async () => {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst value =\n\t\t\t\t\t\t\t\tprops.resolve !== undefined\n\t\t\t\t\t\t\t\t\t? await props.resolve()\n\t\t\t\t\t\t\t\t\t: props.promise !== undefined\n\t\t\t\t\t\t\t\t\t\t? await props.promise\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\tconst nodes = slots.default?.({ value }) ?? [];\n\n\t\t\t\t\t\t\treturn renderVueNodesToHtml(nodes);\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\tconst errorNodes = slots.error?.({ error });\n\t\t\t\t\t\t\tif (errorNodes !== undefined) {\n\t\t\t\t\t\t\t\treturn renderVueNodesToHtml(errorNodes);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (typeof props.errorHtml === 'string') {\n\t\t\t\t\t\t\t\treturn props.errorHtml;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tthrow error;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\ttimeoutMs: props.timeoutMs\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn () => {\n\t\t\tif (!usesFrameworkSlots) {\n\t\t\t\treturn h('div', {\n\t\t\t\t\tclass: props.className,\n\t\t\t\t\t'data-absolute-slot': 'true',\n\t\t\t\t\tid: `slot-${props.id}`,\n\t\t\t\t\tinnerHTML: props.fallbackHtml\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn h(\n\t\t\t\t'div',\n\t\t\t\t{\n\t\t\t\t\tclass: props.className,\n\t\t\t\t\t'data-absolute-slot': 'true',\n\t\t\t\t\tid: `slot-${props.id}`\n\t\t\t\t},\n\t\t\t\tslots.fallback?.() ?? undefined\n\t\t\t);\n\t\t};\n\t}\n});\n",
|
|
6
5
|
"import type { StreamingSlot } from '../utils/streamingSlots';\n\ntype StreamingSlotRegistrar = (slot: StreamingSlot) => void;\n\nconst STREAMING_SLOT_REGISTRAR_KEY = Symbol.for(\n\t'absolutejs.streamingSlotRegistrar'\n);\ntype StreamingSlotRegistrarGlobal = typeof globalThis & {\n\t[STREAMING_SLOT_REGISTRAR_KEY]?: StreamingSlotRegistrar | null;\n};\n\nconst getRegistrarGlobal = () => globalThis as StreamingSlotRegistrarGlobal;\n\nexport const setStreamingSlotRegistrar = (\n\tnextRegistrar: StreamingSlotRegistrar | null\n) => {\n\tgetRegistrarGlobal()[STREAMING_SLOT_REGISTRAR_KEY] = nextRegistrar;\n};\n\nexport const registerStreamingSlot = (slot: StreamingSlot) => {\n\tgetRegistrarGlobal()[STREAMING_SLOT_REGISTRAR_KEY]?.(slot);\n};\n",
|
|
6
|
+
"import {\n\tdefineComponent,\n\th,\n\ttype PropType,\n\ttype Slot,\n\ttype VNodeChild\n} from 'vue';\nimport { registerStreamingSlot } from '../../core/streamingSlotRegistrar';\n\nconst renderVueNodesToHtml = async (nodes: VNodeChild) => {\n\tconst { createSSRApp, h: createVNode } = await import('vue');\n\tconst { renderToString } = await import('vue/server-renderer');\n\n\tconst app = createSSRApp({\n\t\trender: () => createVNode('div', undefined, nodes ?? undefined)\n\t});\n\tconst html = await renderToString(app);\n\n\treturn html.replace(/^<div>|<\\/div>$/g, '');\n};\n\nconst hasFrameworkSlots = (\n\tdefaultSlot: Slot | undefined,\n\tfallbackSlot: Slot | undefined,\n\terrorSlot: Slot | undefined,\n\tpromise: Promise<unknown> | undefined\n) =>\n\tdefaultSlot !== undefined ||\n\tfallbackSlot !== undefined ||\n\terrorSlot !== undefined ||\n\tpromise !== undefined;\n\nexport const SuspenseSlot = defineComponent({\n\tname: 'AbsoluteSuspenseSlot',\n\tprops: {\n\t\tclassName: { default: undefined, type: String },\n\t\terrorHtml: { default: undefined, type: String },\n\t\tfallbackHtml: { default: '', type: String },\n\t\tid: { required: true, type: String },\n\t\tpromise: {\n\t\t\tdefault: undefined,\n\t\t\ttype: Object as PropType<Promise<unknown>>\n\t\t},\n\t\tresolve: {\n\t\t\tdefault: undefined,\n\t\t\ttype: Function as PropType<() => Promise<unknown> | unknown>\n\t\t},\n\t\ttimeoutMs: { default: undefined, type: Number }\n\t},\n\tsetup(props, { slots }) {\n\t\tconst usesFrameworkSlots = hasFrameworkSlots(\n\t\t\tslots.default,\n\t\t\tslots.fallback,\n\t\t\tslots.error,\n\t\t\tprops.promise\n\t\t);\n\n\t\tif (typeof window === 'undefined') {\n\t\t\tif (!usesFrameworkSlots && props.resolve) {\n\t\t\t\tregisterStreamingSlot({\n\t\t\t\t\terrorHtml: props.errorHtml,\n\t\t\t\t\tfallbackHtml: props.fallbackHtml,\n\t\t\t\t\tid: props.id,\n\t\t\t\t\tresolve: props.resolve as () => Promise<string> | string,\n\t\t\t\t\ttimeoutMs: props.timeoutMs\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tregisterStreamingSlot({\n\t\t\t\t\tid: props.id,\n\t\t\t\t\tresolve: async () => {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst value =\n\t\t\t\t\t\t\t\tprops.resolve !== undefined\n\t\t\t\t\t\t\t\t\t? await props.resolve()\n\t\t\t\t\t\t\t\t\t: props.promise !== undefined\n\t\t\t\t\t\t\t\t\t\t? await props.promise\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\tconst nodes = slots.default?.({ value }) ?? [];\n\n\t\t\t\t\t\t\treturn renderVueNodesToHtml(nodes);\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\tconst errorNodes = slots.error?.({ error });\n\t\t\t\t\t\t\tif (errorNodes !== undefined) {\n\t\t\t\t\t\t\t\treturn renderVueNodesToHtml(errorNodes);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (typeof props.errorHtml === 'string') {\n\t\t\t\t\t\t\t\treturn props.errorHtml;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tthrow error;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\ttimeoutMs: props.timeoutMs\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn () => {\n\t\t\tif (!usesFrameworkSlots) {\n\t\t\t\treturn h('div', {\n\t\t\t\t\tclass: props.className,\n\t\t\t\t\t'data-absolute-slot': 'true',\n\t\t\t\t\tid: `slot-${props.id}`,\n\t\t\t\t\tinnerHTML: props.fallbackHtml\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn h(\n\t\t\t\t'div',\n\t\t\t\t{\n\t\t\t\t\tclass: props.className,\n\t\t\t\t\t'data-absolute-slot': 'true',\n\t\t\t\t\tid: `slot-${props.id}`\n\t\t\t\t},\n\t\t\t\tslots.fallback?.() ?? undefined\n\t\t\t);\n\t\t};\n\t}\n});\n",
|
|
7
7
|
"import { defineComponent, h, type PropType } from 'vue';\nimport { registerStreamingSlot } from '../../core/streamingSlotRegistrar';\n\nexport const StreamSlot = defineComponent({\n\tname: 'AbsoluteStreamSlot',\n\tprops: {\n\t\tclassName: { default: undefined, type: String },\n\t\terrorHtml: { default: undefined, type: String },\n\t\tfallbackHtml: { default: '', type: String },\n\t\tid: { required: true, type: String },\n\t\tresolve: {\n\t\t\trequired: true,\n\t\t\ttype: Function as PropType<() => Promise<string> | string>\n\t\t},\n\t\ttimeoutMs: { default: undefined, type: Number }\n\t},\n\tsetup(props) {\n\t\tif (typeof window === 'undefined') {\n\t\t\tregisterStreamingSlot({\n\t\t\t\terrorHtml: props.errorHtml,\n\t\t\t\tfallbackHtml: props.fallbackHtml,\n\t\t\t\tid: props.id,\n\t\t\t\tresolve: props.resolve,\n\t\t\t\ttimeoutMs: props.timeoutMs\n\t\t\t});\n\t\t}\n\n\t\treturn () =>\n\t\t\th('div', {\n\t\t\t\tclass: props.className,\n\t\t\t\t'data-absolute-slot': 'true',\n\t\t\t\tid: `slot-${props.id}`,\n\t\t\t\tinnerHT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AAM;AAAA,QAClB,CAAC;AAAA,MACF;AAAA,MAEA,OAAO,EACN,OACA;AAAA,QACC,OAAO,MAAM;AAAA,QACb,sBAAsB;AAAA,QACtB,IAAI,QAAQ,MAAM;AAAA,MACnB,GACA,MAAM,WAAW,KAAK,SACvB;AAAA;AAAA;AAGH,CAAC;;ACtHD,4BAAS,uBAAiB;AAGnB,IAAM,aAAa,iBAAgB;AAAA,EACzC,MAAM;AAAA,EACN,OAAO;AAAA,IACN,WAAW,EAAE,SAAS,WAAW,MAAM,OAAO;AAAA,IAC9C,WAAW,EAAE,SAAS,WAAW,MAAM,OAAO;AAAA,IAC9C,cAAc,EAAE,SAAS,IAAI,MAAM,OAAO;AAAA,IAC1C,IAAI,EAAE,UAAU,MAAM,MAAM,OAAO;AAAA,IACnC,SAAS;AAAA,MACR,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,WAAW,EAAE,SAAS,WAAW,MAAM,OAAO;AAAA,EAC/C;AAAA,EACA,KAAK,CAAC,OAAO;AAAA,IACZ,IAAI,OAAO,WAAW,aAAa;AAAA,MAClC,sBAAsB;AAAA,QACrB,WAAW,MAAM;AAAA,QACjB,cAAc,MAAM;AAAA,QACpB,IAAI,MAAM;AAAA,QACV,SAAS,MAAM;AAAA,QACf,WAAW,MAAM;AAAA,MAClB,CAAC;AAAA,IACF;AAAA,IAEA,OAAO,MACN,GAAE,OAAO;AAAA,MACR,OAAO,MAAM;AAAA,MACb,sBAAsB;AAAA,MACtB,IAAI,QAAQ,MAAM;AAAA,MAClB,WAAW,MAAM;AAAA,IAClB,CAAC;AAAA;AAEJ,CAAC;",
|
|
10
|
+
"debugId": "A7B4FCB6CBD7CC9D64756E2164756E21",
|
|
11
11
|
"names": []
|
|
12
12
|
}
|
package/dist/vue/index.js
CHANGED
|
@@ -1683,14 +1683,6 @@ var init_renderIslandMarkup = __esm(() => {
|
|
|
1683
1683
|
resolvedServerBuildComponentCache = new Map;
|
|
1684
1684
|
});
|
|
1685
1685
|
|
|
1686
|
-
// src/vue/components/Image.vue
|
|
1687
|
-
var Image_default = "../Image-0pe96k20.vue";
|
|
1688
|
-
// src/vue/components/SuspenseSlot.ts
|
|
1689
|
-
import {
|
|
1690
|
-
defineComponent,
|
|
1691
|
-
h
|
|
1692
|
-
} from "vue";
|
|
1693
|
-
|
|
1694
1686
|
// src/core/streamingSlotRegistrar.ts
|
|
1695
1687
|
var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
|
|
1696
1688
|
var getRegistrarGlobal = () => globalThis;
|
|
@@ -1701,7 +1693,58 @@ var registerStreamingSlot = (slot) => {
|
|
|
1701
1693
|
getRegistrarGlobal()[STREAMING_SLOT_REGISTRAR_KEY]?.(slot);
|
|
1702
1694
|
};
|
|
1703
1695
|
|
|
1696
|
+
// src/core/streamingSlotRegistry.ts
|
|
1697
|
+
var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
|
|
1698
|
+
var getStorageGlobal = () => globalThis;
|
|
1699
|
+
var isServerRuntime = () => typeof process !== "undefined" && typeof process.versions?.node === "string";
|
|
1700
|
+
var ensureAsyncLocalStorage = async () => {
|
|
1701
|
+
const storageGlobal = getStorageGlobal();
|
|
1702
|
+
if (typeof storageGlobal[STREAMING_SLOT_STORAGE_KEY] !== "undefined") {
|
|
1703
|
+
return storageGlobal[STREAMING_SLOT_STORAGE_KEY];
|
|
1704
|
+
}
|
|
1705
|
+
if (!isServerRuntime()) {
|
|
1706
|
+
storageGlobal[STREAMING_SLOT_STORAGE_KEY] = null;
|
|
1707
|
+
return storageGlobal[STREAMING_SLOT_STORAGE_KEY];
|
|
1708
|
+
}
|
|
1709
|
+
const mod = await import("async_hooks");
|
|
1710
|
+
storageGlobal[STREAMING_SLOT_STORAGE_KEY] = new mod.AsyncLocalStorage;
|
|
1711
|
+
return storageGlobal[STREAMING_SLOT_STORAGE_KEY];
|
|
1712
|
+
};
|
|
1713
|
+
var registerStreamingSlot2 = (slot) => {
|
|
1714
|
+
const storage = getStorageGlobal()[STREAMING_SLOT_STORAGE_KEY];
|
|
1715
|
+
if (!storage)
|
|
1716
|
+
return;
|
|
1717
|
+
const store = storage.getStore();
|
|
1718
|
+
if (!store)
|
|
1719
|
+
return;
|
|
1720
|
+
store.set(slot.id, slot);
|
|
1721
|
+
};
|
|
1722
|
+
setStreamingSlotRegistrar(registerStreamingSlot2);
|
|
1723
|
+
var runWithStreamingSlotRegistry = async (task) => {
|
|
1724
|
+
const storage = await ensureAsyncLocalStorage();
|
|
1725
|
+
if (!storage) {
|
|
1726
|
+
return {
|
|
1727
|
+
result: await task(),
|
|
1728
|
+
slots: []
|
|
1729
|
+
};
|
|
1730
|
+
}
|
|
1731
|
+
return storage.run(new Map, async () => {
|
|
1732
|
+
const result = await task();
|
|
1733
|
+
const store = storage.getStore();
|
|
1734
|
+
return {
|
|
1735
|
+
result,
|
|
1736
|
+
slots: store ? [...store.values()] : []
|
|
1737
|
+
};
|
|
1738
|
+
});
|
|
1739
|
+
};
|
|
1740
|
+
|
|
1741
|
+
// src/vue/components/Image.vue
|
|
1742
|
+
var Image_default = "../Image-0pe96k20.vue";
|
|
1704
1743
|
// src/vue/components/SuspenseSlot.ts
|
|
1744
|
+
import {
|
|
1745
|
+
defineComponent,
|
|
1746
|
+
h
|
|
1747
|
+
} from "vue";
|
|
1705
1748
|
var renderVueNodesToHtml = async (nodes) => {
|
|
1706
1749
|
const { createSSRApp, h: createVNode } = await import("vue");
|
|
1707
1750
|
const { renderToString } = await import("vue/server-renderer");
|
|
@@ -2302,51 +2345,6 @@ var appendStreamingSlotPatchesToStream = (stream, slots = [], {
|
|
|
2302
2345
|
});
|
|
2303
2346
|
};
|
|
2304
2347
|
|
|
2305
|
-
// src/core/streamingSlotRegistry.ts
|
|
2306
|
-
var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
|
|
2307
|
-
var getStorageGlobal = () => globalThis;
|
|
2308
|
-
var isServerRuntime = () => typeof process !== "undefined" && typeof process.versions?.node === "string";
|
|
2309
|
-
var ensureAsyncLocalStorage = async () => {
|
|
2310
|
-
const storageGlobal = getStorageGlobal();
|
|
2311
|
-
if (typeof storageGlobal[STREAMING_SLOT_STORAGE_KEY] !== "undefined") {
|
|
2312
|
-
return storageGlobal[STREAMING_SLOT_STORAGE_KEY];
|
|
2313
|
-
}
|
|
2314
|
-
if (!isServerRuntime()) {
|
|
2315
|
-
storageGlobal[STREAMING_SLOT_STORAGE_KEY] = null;
|
|
2316
|
-
return storageGlobal[STREAMING_SLOT_STORAGE_KEY];
|
|
2317
|
-
}
|
|
2318
|
-
const mod = await import("async_hooks");
|
|
2319
|
-
storageGlobal[STREAMING_SLOT_STORAGE_KEY] = new mod.AsyncLocalStorage;
|
|
2320
|
-
return storageGlobal[STREAMING_SLOT_STORAGE_KEY];
|
|
2321
|
-
};
|
|
2322
|
-
var registerStreamingSlot2 = (slot) => {
|
|
2323
|
-
const storage = getStorageGlobal()[STREAMING_SLOT_STORAGE_KEY];
|
|
2324
|
-
if (!storage)
|
|
2325
|
-
return;
|
|
2326
|
-
const store = storage.getStore();
|
|
2327
|
-
if (!store)
|
|
2328
|
-
return;
|
|
2329
|
-
store.set(slot.id, slot);
|
|
2330
|
-
};
|
|
2331
|
-
setStreamingSlotRegistrar(registerStreamingSlot2);
|
|
2332
|
-
var runWithStreamingSlotRegistry = async (task) => {
|
|
2333
|
-
const storage = await ensureAsyncLocalStorage();
|
|
2334
|
-
if (!storage) {
|
|
2335
|
-
return {
|
|
2336
|
-
result: await task(),
|
|
2337
|
-
slots: []
|
|
2338
|
-
};
|
|
2339
|
-
}
|
|
2340
|
-
return storage.run(new Map, async () => {
|
|
2341
|
-
const result = await task();
|
|
2342
|
-
const store = storage.getStore();
|
|
2343
|
-
return {
|
|
2344
|
-
result,
|
|
2345
|
-
slots: store ? [...store.values()] : []
|
|
2346
|
-
};
|
|
2347
|
-
});
|
|
2348
|
-
};
|
|
2349
|
-
|
|
2350
2348
|
// src/core/responseEnhancers.ts
|
|
2351
2349
|
var toResponse = async (responseLike) => await responseLike;
|
|
2352
2350
|
var cloneHeaders = (response) => {
|
|
@@ -2711,5 +2709,5 @@ export {
|
|
|
2711
2709
|
Image_default as Image
|
|
2712
2710
|
};
|
|
2713
2711
|
|
|
2714
|
-
//# debugId=
|
|
2712
|
+
//# debugId=4A22078C48220D5A64756E2164756E21
|
|
2715
2713
|
//# sourceMappingURL=index.js.map
|