deepwoken 0.2.6 → 0.2.8
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/index.ts +13 -12
- package/package.json +1 -1
- package/pkg/deepwoken_bg.wasm +0 -0
package/index.ts
CHANGED
|
@@ -5,21 +5,22 @@ export type { Atom, Clause, ClauseType, Reducability } from './requirement.js';
|
|
|
5
5
|
import type { Aspect, Mantra, Outfit, Stat, Talent, Weapon } from './types.js';
|
|
6
6
|
import type { Clause } from './requirement.js';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
const wasm = await import('./pkg/deepwoken.js');
|
|
9
|
+
|
|
10
|
+
if (typeof process !== 'undefined' && process.versions?.node) {
|
|
11
|
+
const { readFile } = await import('node:fs/promises');
|
|
12
|
+
const { fileURLToPath } = await import('node:url');
|
|
13
|
+
const wasmPath = fileURLToPath(new URL('./pkg/deepwoken_bg.wasm', import.meta.url));
|
|
14
|
+
await wasm.default(await readFile(wasmPath));
|
|
15
|
+
} else {
|
|
16
16
|
await wasm.default();
|
|
17
|
-
WasmDeepData = wasm.DeepData;
|
|
18
|
-
WasmStatMap = wasm.StatMap;
|
|
19
|
-
WasmRequirement = wasm.Requirement;
|
|
20
|
-
wasmNameToIdentifier = wasm.nameToIdentifier;
|
|
21
17
|
}
|
|
22
18
|
|
|
19
|
+
const WasmDeepData = wasm.DeepData;
|
|
20
|
+
const WasmStatMap = wasm.StatMap;
|
|
21
|
+
const WasmRequirement = wasm.Requirement;
|
|
22
|
+
const wasmNameToIdentifier = wasm.nameToIdentifier;
|
|
23
|
+
|
|
23
24
|
export class DeepData {
|
|
24
25
|
private _wasm: any;
|
|
25
26
|
|
package/package.json
CHANGED
package/pkg/deepwoken_bg.wasm
CHANGED
|
Binary file
|