@bendyline/molen-pack 0.0.5 → 0.0.6
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/index.d.mts +2 -2
- package/dist/index.mjs +8 -8
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -5,8 +5,8 @@ import { PackIndex, PackIndexEntry, PackManifest } from "@bendyline/molen-schema
|
|
|
5
5
|
//#region src/set.d.ts
|
|
6
6
|
/** The shape of the client's AssetProvider, so this package needs no client dependency. */
|
|
7
7
|
interface AssetProviderLike {
|
|
8
|
-
load(ref: string): Promise<ArrayBuffer>;
|
|
9
|
-
loadText(ref: string): Promise<string>;
|
|
8
|
+
load(ref: string, options?: ReadOptions): Promise<ArrayBuffer>;
|
|
9
|
+
loadText(ref: string, options?: ReadOptions): Promise<string>;
|
|
10
10
|
}
|
|
11
11
|
interface PackAssetProviderOptions {
|
|
12
12
|
/** Prefer this variant (e.g. "ktx2") when the manifest lists one for the asset. */
|
package/dist/index.mjs
CHANGED
|
@@ -81,17 +81,17 @@ var Packs = class {
|
|
|
81
81
|
} : hit;
|
|
82
82
|
};
|
|
83
83
|
return {
|
|
84
|
-
load: async (ref) => {
|
|
84
|
+
load: async (ref, readOptions) => {
|
|
85
85
|
const hit = pick(ref);
|
|
86
|
-
if (hit !== void 0) return hit.pack.readBytes(hit.path);
|
|
87
|
-
if (options.fallback !== void 0) return options.fallback.load(ref);
|
|
88
|
-
return this.readBytes(ref);
|
|
86
|
+
if (hit !== void 0) return hit.pack.readBytes(hit.path, readOptions);
|
|
87
|
+
if (options.fallback !== void 0) return options.fallback.load(ref, readOptions);
|
|
88
|
+
return this.readBytes(ref, readOptions);
|
|
89
89
|
},
|
|
90
|
-
loadText: async (ref) => {
|
|
90
|
+
loadText: async (ref, readOptions) => {
|
|
91
91
|
const hit = this.resolve(ref);
|
|
92
|
-
if (hit !== void 0) return hit.pack.readText(hit.path);
|
|
93
|
-
if (options.fallback !== void 0) return options.fallback.loadText(ref);
|
|
94
|
-
return this.readText(ref);
|
|
92
|
+
if (hit !== void 0) return hit.pack.readText(hit.path, readOptions);
|
|
93
|
+
if (options.fallback !== void 0) return options.fallback.loadText(ref, readOptions);
|
|
94
|
+
return this.readText(ref, readOptions);
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
97
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bendyline/molen-pack",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"fflate": "0.8.3",
|
|
49
|
-
"@bendyline/molen-schema": "0.0.
|
|
49
|
+
"@bendyline/molen-schema": "0.0.5"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@biomejs/biome": "^2.5.0",
|