motely-wasm 18.2.2 → 18.2.4
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/README.md +11 -19
- package/bin/{dotnet.native.wasm → motely-wasm.wasm} +0 -0
- package/dist/bcl/cancellation.d.mts +14 -0
- package/dist/bcl/cancellation.mjs +21 -0
- package/dist/bcl/collection.d.mts +22 -0
- package/dist/bcl/collection.mjs +42 -0
- package/dist/bcl/index.d.mts +3 -0
- package/dist/bcl/index.mjs +3 -0
- package/dist/boot.d.mts +2 -2
- package/dist/boot.mjs +4 -4
- package/dist/config.mjs +8 -2
- package/dist/dotnet/dotnet.native.js +1 -1
- package/dist/generated/imports.g.mjs +20 -158
- package/dist/generated/instances.g.mjs +142 -31
- package/dist/generated/{bootsharp → modules/bootsharp}/file-system.g.d.mts +33 -43
- package/dist/generated/{bootsharp → modules/bootsharp}/file-system.g.mjs +30 -11
- package/dist/generated/modules/index.g.d.mts +132 -0
- package/dist/generated/modules/index.g.mjs +135 -0
- package/dist/generated/{motely → modules/motely}/analysis.g.d.mts +16 -24
- package/dist/generated/{six-labors/image-sharp/color-spaces.g.mjs → modules/motely/analysis.g.mjs} +2 -2
- package/dist/generated/modules/motely/enums.g.d.mts +458 -0
- package/dist/generated/modules/motely/enums.g.mjs +890 -0
- package/dist/generated/modules/motely/filters/jaml.g.d.mts +9 -0
- package/dist/generated/modules/motely/filters/jaml.g.mjs +18 -0
- package/dist/generated/modules/motely/filters.g.d.mts +14 -0
- package/dist/generated/{motely/filters/native.g.mjs → modules/motely/filters.g.mjs} +2 -2
- package/dist/generated/modules/motely/seed-providers.g.d.mts +6 -0
- package/dist/generated/modules/motely/seed-providers.g.mjs +11 -0
- package/dist/generated/modules/motely.g.d.mts +94 -0
- package/dist/generated/modules/motely.g.mjs +101 -0
- package/dist/generated/modules/system/threading.g.d.mts +6 -0
- package/dist/generated/modules/system/threading.g.mjs +9 -0
- package/dist/generated/modules/system.g.d.mts +3 -0
- package/dist/generated/modules/system.g.mjs +15 -0
- package/dist/generated/resources.g.d.mts +3 -3
- package/dist/generated/resources.g.mjs +5 -3
- package/dist/generated/{serialization.g.mjs → serializer.g.mjs} +54 -51
- package/dist/imports.d.mts +1 -1
- package/dist/imports.mjs +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/instances.d.mts +2 -2
- package/dist/instances.mjs +8 -4
- package/dist/node-boot.mjs +35 -0
- package/dist/resources.d.mts +6 -6
- package/dist/resources.mjs +6 -3
- package/dist/serialization/index.d.mts +10 -0
- package/dist/serialization/index.mjs +4 -0
- package/dist/serialization/reader.d.mts +22 -0
- package/dist/serialization/reader.mjs +94 -0
- package/dist/serialization/serializer.d.mts +15 -0
- package/dist/serialization/serializer.mjs +20 -0
- package/dist/serialization/std.d.mts +24 -0
- package/dist/serialization/std.mjs +97 -0
- package/dist/serialization/writer.d.mts +25 -0
- package/dist/serialization/writer.mjs +122 -0
- package/jaml.schema.json +5298 -4553
- package/package.json +3 -2
- package/dist/generated/bootsharp/inject.g.mjs +0 -6
- package/dist/generated/bootsharp.g.mjs +0 -6
- package/dist/generated/index.g.d.mts +0 -60
- package/dist/generated/index.g.mjs +0 -63
- package/dist/generated/jet-brains/annotations.g.mjs +0 -6
- package/dist/generated/motely/analysis.g.mjs +0 -12
- package/dist/generated/motely/enums.g.d.mts +0 -448
- package/dist/generated/motely/enums.g.mjs +0 -18
- package/dist/generated/motely/filters/converters.g.mjs +0 -6
- package/dist/generated/motely/filters/jaml/converters.g.mjs +0 -6
- package/dist/generated/motely/filters/jaml.g.d.mts +0 -10
- package/dist/generated/motely/filters/jaml.g.mjs +0 -7
- package/dist/generated/motely/filters.g.d.mts +0 -8
- package/dist/generated/motely/filters.g.mjs +0 -6
- package/dist/generated/motely/wasm.g.d.mts +0 -8
- package/dist/generated/motely/wasm.g.mjs +0 -11
- package/dist/generated/motely.g.d.mts +0 -59
- package/dist/generated/motely.g.mjs +0 -45
- package/dist/generated/six-labors/image-sharp/advanced.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/color-spaces/companding.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/color-spaces/conversion.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/compression/zlib.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/diagnostics.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/formats/bmp.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/formats/gif.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/formats/jpeg/components/encoder.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/formats/jpeg.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/formats/pbm.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/formats/png/chunks.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/formats/png.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/formats/qoi.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/formats/tga.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/formats/tiff/compression/decompressors.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/formats/tiff/compression.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/formats/tiff/constants.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/formats/tiff.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/formats/webp.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/formats.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/memory.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/metadata/profiles/cicp.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/metadata/profiles/exif.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/metadata/profiles/icc.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/metadata/profiles/iptc.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/metadata/profiles/xmp.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/metadata.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/pixel-formats.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/processing/processors/binarization.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/processing/processors/convolution.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/processing/processors/dithering.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/processing/processors/drawing.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/processing/processors/effects.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/processing/processors/filters.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/processing/processors/normalization.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/processing/processors/overlays.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/processing/processors/quantization.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/processing/processors/transforms.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/processing/processors.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp/processing.g.mjs +0 -6
- package/dist/generated/six-labors/image-sharp.g.mjs +0 -6
- package/dist/generated/system/collections/generic.g.mjs +0 -6
- package/dist/generated/system/threading.g.d.mts +0 -4
- package/dist/generated/system/threading.g.mjs +0 -6
- package/dist/generated/system.g.mjs +0 -6
- package/dist/generated/yaml-dot-net/core/events.g.mjs +0 -6
- package/dist/generated/yaml-dot-net/core/tokens.g.mjs +0 -6
- package/dist/generated/yaml-dot-net/core.g.mjs +0 -6
- package/dist/generated/yaml-dot-net/helpers.g.mjs +0 -6
- package/dist/generated/yaml-dot-net/representation-model.g.mjs +0 -6
- package/dist/generated/yaml-dot-net/serialization/buffered-deserialization/type-discriminators.g.mjs +0 -6
- package/dist/generated/yaml-dot-net/serialization/buffered-deserialization.g.mjs +0 -6
- package/dist/generated/yaml-dot-net/serialization/callbacks.g.mjs +0 -6
- package/dist/generated/yaml-dot-net/serialization/converters.g.mjs +0 -6
- package/dist/generated/yaml-dot-net/serialization/event-emitters.g.mjs +0 -6
- package/dist/generated/yaml-dot-net/serialization/naming-conventions.g.mjs +0 -6
- package/dist/generated/yaml-dot-net/serialization/node-deserializers.g.mjs +0 -6
- package/dist/generated/yaml-dot-net/serialization/node-type-resolvers.g.mjs +0 -6
- package/dist/generated/yaml-dot-net/serialization/object-factories.g.mjs +0 -6
- package/dist/generated/yaml-dot-net/serialization/object-graph-traversal-strategies.g.mjs +0 -6
- package/dist/generated/yaml-dot-net/serialization/object-graph-visitors.g.mjs +0 -6
- package/dist/generated/yaml-dot-net/serialization/schemas.g.mjs +0 -6
- package/dist/generated/yaml-dot-net/serialization/type-inspectors.g.mjs +0 -6
- package/dist/generated/yaml-dot-net/serialization/type-resolvers.g.mjs +0 -6
- package/dist/generated/yaml-dot-net/serialization/utilities.g.mjs +0 -6
- package/dist/generated/yaml-dot-net/serialization/value-deserializers.g.mjs +0 -6
- package/dist/generated/yaml-dot-net/serialization.g.mjs +0 -6
- package/dist/serialization.d.mts +0 -90
- package/dist/serialization.mjs +0 -331
- /package/dist/{event.d.mts → bcl/event.d.mts} +0 -0
- /package/dist/{event.mjs → bcl/event.mjs} +0 -0
package/README.md
CHANGED
|
@@ -58,9 +58,7 @@ Pass the URL path your host serves the package's `bin/` directory at (where
|
|
|
58
58
|
| --- | --- | --- |
|
|
59
59
|
| Vite / Storybook `staticDirs` | `/motely-wasm/bin` | `boot("/motely-wasm/bin")` |
|
|
60
60
|
| Next.js route handler | `/motely-wasm/bin/[...path]` | `boot("/motely-wasm/bin")` |
|
|
61
|
-
|
|
|
62
|
-
| Raw node_modules served as static | `/node_modules/motely-wasm/bin` | `boot("/node_modules/motely-wasm/bin")` |
|
|
63
|
-
| Public CDN | `https://unpkg.com/motely-wasm/bin` | `boot("https://unpkg.com/motely-wasm/bin")` |
|
|
61
|
+
| Public CDN (pinned version) | `https://unpkg.com/motely-wasm@<version>/bin` | `boot("https://unpkg.com/motely-wasm@18.2.2/bin")` |
|
|
64
62
|
|
|
65
63
|
Web Workers must boot from the **same** URL as the main thread — absolute paths
|
|
66
64
|
in a worker resolve against the page origin, so whichever URL serves the WASM
|
|
@@ -78,29 +76,23 @@ console.log(bootsharp.getStatus()); // BootStatus.Booted
|
|
|
78
76
|
|
|
79
77
|
### Node / Bun / Deno
|
|
80
78
|
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
Same ESM import as the browser. Point `boot()` at the published `bin/` directory
|
|
80
|
+
(Node `fetch` accepts `file://` URLs):
|
|
83
81
|
|
|
84
82
|
```js
|
|
85
|
-
import {
|
|
86
|
-
import { fileURLToPath } from "node:url";
|
|
87
|
-
import bootsharp from "motely-wasm";
|
|
83
|
+
import bootsharp, { Motely } from "motely-wasm";
|
|
88
84
|
|
|
89
|
-
const
|
|
90
|
-
|
|
85
|
+
const binRoot = new URL("bin/", import.meta.resolve("motely-wasm/package.json")).href;
|
|
86
|
+
await bootsharp.boot(binRoot);
|
|
91
87
|
|
|
92
|
-
|
|
93
|
-
wasm: wasmBytes.buffer.slice(
|
|
94
|
-
wasmBytes.byteOffset,
|
|
95
|
-
wasmBytes.byteOffset + wasmBytes.byteLength
|
|
96
|
-
),
|
|
97
|
-
});
|
|
88
|
+
const status = Motely.validateJaml(jaml);
|
|
98
89
|
```
|
|
99
90
|
|
|
100
|
-
Requires Node ≥ 20.6 (
|
|
91
|
+
Requires Node ≥ 20.6 (`import.meta.resolve`). Node 22 LTS is the recommended floor.
|
|
101
92
|
|
|
102
|
-
|
|
103
|
-
|
|
93
|
+
**Publish gate (repo):** after `dotnet publish Motely.Wasm -c Release`, run
|
|
94
|
+
`node Motely.Wasm/motely.test.mjs` and `node Motely.Wasm/pack-consumer-smoke.mjs`
|
|
95
|
+
(`npm pack` → fresh `npm install` → same boot path).
|
|
104
96
|
|
|
105
97
|
## JAML API
|
|
106
98
|
|
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Event } from "./event.mjs";
|
|
2
|
+
/** JavaScript counterpart of the C# <c>System.Threading.CancellationToken</c> specialization.
|
|
3
|
+
* Hand-rolled instances are constructed in user code and passed across the interop boundary;
|
|
4
|
+
* instances received from C# are wrapped into generated proxies that expose the same shape. */
|
|
5
|
+
export declare class CancellationToken {
|
|
6
|
+
private cancelled;
|
|
7
|
+
/** Fires when the token is cancelled. */
|
|
8
|
+
readonly onCancellationRequested: Event<[]>;
|
|
9
|
+
/** Whether cancellation has been requested. */
|
|
10
|
+
get isCancellationRequested(): boolean;
|
|
11
|
+
/** Signal cancellation: flips <see cref="isCancellationRequested"/> and broadcasts
|
|
12
|
+
* <see cref="onCancellationRequested"/>. Idempotent. */
|
|
13
|
+
cancel(): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Event } from "./event.mjs";
|
|
2
|
+
/** JavaScript counterpart of the C# <c>System.Threading.CancellationToken</c> specialization.
|
|
3
|
+
* Hand-rolled instances are constructed in user code and passed across the interop boundary;
|
|
4
|
+
* instances received from C# are wrapped into generated proxies that expose the same shape. */
|
|
5
|
+
export class CancellationToken {
|
|
6
|
+
cancelled = false;
|
|
7
|
+
/** Fires when the token is cancelled. */
|
|
8
|
+
onCancellationRequested = new Event();
|
|
9
|
+
/** Whether cancellation has been requested. */
|
|
10
|
+
get isCancellationRequested() {
|
|
11
|
+
return this.cancelled;
|
|
12
|
+
}
|
|
13
|
+
/** Signal cancellation: flips <see cref="isCancellationRequested"/> and broadcasts
|
|
14
|
+
* <see cref="onCancellationRequested"/>. Idempotent. */
|
|
15
|
+
cancel() {
|
|
16
|
+
if (this.cancelled)
|
|
17
|
+
return;
|
|
18
|
+
this.cancelled = true;
|
|
19
|
+
this.onCancellationRequested.broadcast();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** JavaScript counterpart of the C# <c>Bootsharp.Collection<T></c> specialization of
|
|
2
|
+
* <c>System.Collections.Generic.ICollection<T></c>. Hand-rolled instances are constructed in
|
|
3
|
+
* user code and passed across the interop boundary; instances received from C# are wrapped into
|
|
4
|
+
* generated proxies that expose the same shape. */
|
|
5
|
+
export declare class Collection<T> {
|
|
6
|
+
private readonly items;
|
|
7
|
+
constructor(items?: Iterable<T>);
|
|
8
|
+
/** Number of items in the collection. */
|
|
9
|
+
get count(): number;
|
|
10
|
+
/** Adds the specified item to the collection. */
|
|
11
|
+
add(item: T): void;
|
|
12
|
+
/** Removes the first occurrence of the specified item from the collection.
|
|
13
|
+
* @returns true when the item was removed; false when it wasn't found. */
|
|
14
|
+
remove(item: T): boolean;
|
|
15
|
+
/** Removes all items from the collection. */
|
|
16
|
+
clear(): void;
|
|
17
|
+
/** Whether the collection contains the specified item. */
|
|
18
|
+
contains(item: T): boolean;
|
|
19
|
+
/** Returns a fresh array with a snapshot of the current items. */
|
|
20
|
+
copy(): T[];
|
|
21
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/** JavaScript counterpart of the C# <c>Bootsharp.Collection<T></c> specialization of
|
|
2
|
+
* <c>System.Collections.Generic.ICollection<T></c>. Hand-rolled instances are constructed in
|
|
3
|
+
* user code and passed across the interop boundary; instances received from C# are wrapped into
|
|
4
|
+
* generated proxies that expose the same shape. */
|
|
5
|
+
export class Collection {
|
|
6
|
+
items;
|
|
7
|
+
constructor(items) {
|
|
8
|
+
this.items = items != null ? Array.from(items) : [];
|
|
9
|
+
}
|
|
10
|
+
/** Number of items in the collection. */
|
|
11
|
+
get count() {
|
|
12
|
+
return this.items.length;
|
|
13
|
+
}
|
|
14
|
+
/** Adds the specified item to the collection. */
|
|
15
|
+
add(item) {
|
|
16
|
+
this.items.push(item);
|
|
17
|
+
}
|
|
18
|
+
/** Removes the first occurrence of the specified item from the collection.
|
|
19
|
+
* @returns true when the item was removed; false when it wasn't found. */
|
|
20
|
+
remove(item) {
|
|
21
|
+
const idx = this.items.indexOf(item);
|
|
22
|
+
if (idx < 0)
|
|
23
|
+
return false;
|
|
24
|
+
this.items.splice(idx, 1);
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
/** Removes all items from the collection. */
|
|
28
|
+
clear() {
|
|
29
|
+
this.items.length = 0;
|
|
30
|
+
}
|
|
31
|
+
/** Whether the collection contains the specified item. */
|
|
32
|
+
contains(item) {
|
|
33
|
+
return this.items.indexOf(item) >= 0;
|
|
34
|
+
}
|
|
35
|
+
/** Returns a fresh array with a snapshot of the current items. */
|
|
36
|
+
copy() {
|
|
37
|
+
return this.items.slice();
|
|
38
|
+
}
|
|
39
|
+
[Symbol.iterator]() {
|
|
40
|
+
return this.copy()[Symbol.iterator]();
|
|
41
|
+
}
|
|
42
|
+
}
|
package/dist/boot.d.mts
CHANGED
|
@@ -24,11 +24,11 @@ export type BootOptions = {
|
|
|
24
24
|
};
|
|
25
25
|
/** Returns current runtime module lifecycle state. */
|
|
26
26
|
export declare function getStatus(): BootStatus;
|
|
27
|
-
/** Initializes the runtime
|
|
27
|
+
/** Initializes the runtime. When not in embedded mode, resources parameter has to be specified.
|
|
28
28
|
* @param resources Either URL to the boot resources root (eg, <code>/bin</code>) or the preloaded content.
|
|
29
29
|
* @param options Allows customizing the boot process and the runtime behaviour.
|
|
30
30
|
* @return Promise that resolves into the runtime instance when the initialization is finished. */
|
|
31
|
-
export declare function boot(resources
|
|
31
|
+
export declare function boot(resources?: string | BootResources, options?: BootOptions): Promise<RuntimeAPI>;
|
|
32
32
|
/** Terminates the runtime and removes WASM module from memory.
|
|
33
33
|
* @param code Exit code; will use 0 (normal exit) by default.
|
|
34
34
|
* @param reason Exit reason description (optional). */
|
package/dist/boot.mjs
CHANGED
|
@@ -19,7 +19,7 @@ let status = BootStatus.Standby;
|
|
|
19
19
|
export function getStatus() {
|
|
20
20
|
return status;
|
|
21
21
|
}
|
|
22
|
-
/** Initializes the runtime
|
|
22
|
+
/** Initializes the runtime. When not in embedded mode, resources parameter has to be specified.
|
|
23
23
|
* @param resources Either URL to the boot resources root (eg, <code>/bin</code>) or the preloaded content.
|
|
24
24
|
* @param options Allows customizing the boot process and the runtime behaviour.
|
|
25
25
|
* @return Promise that resolves into the runtime instance when the initialization is finished. */
|
|
@@ -37,7 +37,7 @@ export async function boot(resources, options) {
|
|
|
37
37
|
* @param code Exit code; will use 0 (normal exit) by default.
|
|
38
38
|
* @param reason Exit reason description (optional). */
|
|
39
39
|
export async function exit(code, reason) {
|
|
40
|
-
/* v8 ignore start --
|
|
40
|
+
/* v8 ignore start -- uncoverable, as exit terminates the host test process */
|
|
41
41
|
if (status !== BootStatus.Booted)
|
|
42
42
|
throw Error("Failed to exit the C# runtime: not booted.");
|
|
43
43
|
try {
|
|
@@ -47,10 +47,10 @@ export async function exit(code, reason) {
|
|
|
47
47
|
finally {
|
|
48
48
|
status = BootStatus.Standby;
|
|
49
49
|
}
|
|
50
|
-
/* v8 ignore stop
|
|
50
|
+
/* v8 ignore stop */
|
|
51
51
|
}
|
|
52
52
|
async function createRuntime(res, opt) {
|
|
53
|
-
const cfg = opt.config ?? buildConfig(typeof res === "
|
|
53
|
+
const cfg = opt.config ?? buildConfig(typeof res === "object" ? res : await fetchResources(res));
|
|
54
54
|
const runtime = await opt.create?.(cfg) || await app.dotnet.withConfig(cfg).create();
|
|
55
55
|
setRuntime(runtime);
|
|
56
56
|
if (opt.import)
|
package/dist/config.mjs
CHANGED
|
@@ -21,11 +21,12 @@ export function buildConfig(resources) {
|
|
|
21
21
|
return { name, moduleExports: exports };
|
|
22
22
|
}
|
|
23
23
|
function resolveAsset(res) {
|
|
24
|
-
|
|
24
|
+
const buffer = resolveBinary(res.content);
|
|
25
|
+
return { name: res.name, virtualPath: res.name, buffer };
|
|
25
26
|
}
|
|
26
27
|
function resolveSymbols(res) {
|
|
27
28
|
// Use 'resolveAsset<SymbolsAsset>()' once https://github.com/dotnet/runtime/pull/127087 is merged.
|
|
28
|
-
const txt = new TextDecoder("utf-8").decode(res.content);
|
|
29
|
+
const txt = new TextDecoder("utf-8").decode(resolveBinary(res.content));
|
|
29
30
|
return {
|
|
30
31
|
name: res.name,
|
|
31
32
|
pendingDownload: {
|
|
@@ -42,4 +43,9 @@ export function buildConfig(resources) {
|
|
|
42
43
|
return "all";
|
|
43
44
|
return "sharded";
|
|
44
45
|
}
|
|
46
|
+
function resolveBinary(content) {
|
|
47
|
+
if (typeof content !== "string")
|
|
48
|
+
return content;
|
|
49
|
+
return Uint8Array.fromBase64(content).buffer;
|
|
50
|
+
}
|
|
45
51
|
}
|