@arcjet/analyze-wasm 1.0.0-beta.10 → 1.0.0-beta.11

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.
@@ -24,7 +24,7 @@
24
24
  * properly support consistent asset bundling techniques.
25
25
  */
26
26
 
27
- const wasmBase64 = "data:application/wasm;base64,AGFzbQEAAAABFQNgA39/fwBgBH9/f38Bf2ACf38BfwMIBwABAgICAgAEBQFwAQcHBygIATAAAAExAAEBMgACATMAAwE0AAQBNQAFATYABggkaW1wb3J0cwEACl0HDQAgACABIAJBABEAAAsPACAAIAEgAiADQQERAQALCwAgACABQQIRAgALCwAgACABQQMRAgALCwAgACABQQQRAgALCwAgACABQQURAgALDQAgACABIAJBBhEAAAsALwlwcm9kdWNlcnMBDHByb2Nlc3NlZC1ieQENd2l0LWNvbXBvbmVudAcwLjIzMC4wALwDBG5hbWUAExJ3aXQtY29tcG9uZW50OnNoaW0BnwMHACxpbmRpcmVjdC1hcmNqZXQ6anMtcmVxL2JvdC1pZGVudGlmaWVyLWRldGVjdAEoaW5kaXJlY3QtYXJjamV0OmpzLXJlcS92ZXJpZnktYm90LXZlcmlmeQI+aW5kaXJlY3QtYXJjamV0OmpzLXJlcS9lbWFpbC12YWxpZGF0b3Itb3ZlcnJpZGVzLWlzLWZyZWUtZW1haWwDRGluZGlyZWN0LWFyY2pldDpqcy1yZXEvZW1haWwtdmFsaWRhdG9yLW92ZXJyaWRlcy1pcy1kaXNwb3NhYmxlLWVtYWlsBD9pbmRpcmVjdC1hcmNqZXQ6anMtcmVxL2VtYWlsLXZhbGlkYXRvci1vdmVycmlkZXMtaGFzLW14LXJlY29yZHMFPWluZGlyZWN0LWFyY2pldDpqcy1yZXEvZW1haWwtdmFsaWRhdG9yLW92ZXJyaWRlcy1oYXMtZ3JhdmF0YXIGPmluZGlyZWN0LWFyY2pldDpqcy1yZXEvc2Vuc2l0aXZlLWluZm9ybWF0aW9uLWlkZW50aWZpZXItZGV0ZWN0";
27
+ const wasmBase64 = "data:application/wasm;base64,AGFzbQEAAAABFQNgA39/fwBgBH9/f38Bf2ACf38BfwMIBwABAgICAgAEBQFwAQcHBygIATAAAAExAAEBMgACATMAAwE0AAQBNQAFATYABggkaW1wb3J0cwEACl0HDQAgACABIAJBABEAAAsPACAAIAEgAiADQQERAQALCwAgACABQQIRAgALCwAgACABQQMRAgALCwAgACABQQQRAgALCwAgACABQQURAgALDQAgACABIAJBBhEAAAsALwlwcm9kdWNlcnMBDHByb2Nlc3NlZC1ieQENd2l0LWNvbXBvbmVudAcwLjIzNS4wALwDBG5hbWUAExJ3aXQtY29tcG9uZW50OnNoaW0BnwMHACxpbmRpcmVjdC1hcmNqZXQ6anMtcmVxL2JvdC1pZGVudGlmaWVyLWRldGVjdAEoaW5kaXJlY3QtYXJjamV0OmpzLXJlcS92ZXJpZnktYm90LXZlcmlmeQI+aW5kaXJlY3QtYXJjamV0OmpzLXJlcS9lbWFpbC12YWxpZGF0b3Itb3ZlcnJpZGVzLWlzLWZyZWUtZW1haWwDRGluZGlyZWN0LWFyY2pldDpqcy1yZXEvZW1haWwtdmFsaWRhdG9yLW92ZXJyaWRlcy1pcy1kaXNwb3NhYmxlLWVtYWlsBD9pbmRpcmVjdC1hcmNqZXQ6anMtcmVxL2VtYWlsLXZhbGlkYXRvci1vdmVycmlkZXMtaGFzLW14LXJlY29yZHMFPWluZGlyZWN0LWFyY2pldDpqcy1yZXEvZW1haWwtdmFsaWRhdG9yLW92ZXJyaWRlcy1oYXMtZ3JhdmF0YXIGPmluZGlyZWN0LWFyY2pldDpqcy1yZXEvc2Vuc2l0aXZlLWluZm9ybWF0aW9uLWlkZW50aWZpZXItZGV0ZWN0";
28
28
  /**
29
29
  * Returns a WebAssembly.Module for an Arcjet Wasm binary, decoded from a base64
30
30
  * Data URL.
@@ -24,7 +24,7 @@
24
24
  * properly support consistent asset bundling techniques.
25
25
  */
26
26
 
27
- const wasmBase64 = "data:application/wasm;base64,AGFzbQEAAAABFQNgA39/fwBgBH9/f38Bf2ACf38BfwIzCAABMAAAAAExAAEAATIAAgABMwACAAE0AAIAATUAAgABNgAAAAgkaW1wb3J0cwFwAQcHCQ0BAEEACwcAAQIDBAUGAC8JcHJvZHVjZXJzAQxwcm9jZXNzZWQtYnkBDXdpdC1jb21wb25lbnQHMC4yMzAuMAAcBG5hbWUAFRR3aXQtY29tcG9uZW50OmZpeHVwcw==";
27
+ const wasmBase64 = "data:application/wasm;base64,AGFzbQEAAAABFQNgA39/fwBgBH9/f38Bf2ACf38BfwIzCAABMAAAAAExAAEAATIAAgABMwACAAE0AAIAATUAAgABNgAAAAgkaW1wb3J0cwFwAQcHCQ0BAEEACwcAAQIDBAUGAC8JcHJvZHVjZXJzAQxwcm9jZXNzZWQtYnkBDXdpdC1jb21wb25lbnQHMC4yMzUuMAAcBG5hbWUAFRR3aXQtY29tcG9uZW50OmZpeHVwcw==";
28
28
  /**
29
29
  * Returns a WebAssembly.Module for an Arcjet Wasm binary, decoded from a base64
30
30
  * Data URL.
package/edge-light.d.ts CHANGED
@@ -1,5 +1,11 @@
1
- import type { ImportObject, DetectedSensitiveInfoEntity, SensitiveInfoEntity, BotConfig, EmailValidationResult, BotResult, SensitiveInfoResult, EmailValidationConfig, SensitiveInfoEntities } from "./wasm/arcjet_analyze_js_req.component.js";
2
- import type { ArcjetJsReqSensitiveInformationIdentifier } from "./wasm/interfaces/arcjet-js-req-sensitive-information-identifier.js";
3
- type DetectSensitiveInfoFunction = typeof ArcjetJsReqSensitiveInformationIdentifier.detect;
1
+ import type { ImportObject } from "./wasm/arcjet_analyze_js_req.component.js";
2
+ /**
3
+ * Initialize the generated WebAssembly component.
4
+ *
5
+ * @param coreImports
6
+ * Things, typically functions, to pass into the component.
7
+ * @returns
8
+ * Promise that resolves to the initialized component.
9
+ */
4
10
  export declare function initializeWasm(coreImports: ImportObject): Promise<import("./wasm/arcjet_analyze_js_req.component.js").Root | undefined>;
5
- export { type BotConfig, type DetectedSensitiveInfoEntity, type SensitiveInfoEntity, type EmailValidationConfig, type EmailValidationResult, type BotResult, type SensitiveInfoResult, type SensitiveInfoEntities, type DetectSensitiveInfoFunction, type ImportObject, };
11
+ export type { BotConfig, BotResult, DetectSensitiveInfoFunction, DetectedSensitiveInfoEntity, EmailValidationConfig, EmailValidationResult, ImportObject, FilterResult, SensitiveInfoEntities, SensitiveInfoEntity, SensitiveInfoResult, } from "./types.js";
package/edge-light.js CHANGED
@@ -15,6 +15,14 @@ async function moduleFromPath(path) {
15
15
  }
16
16
  throw new Error(`Unknown path: ${path}`);
17
17
  }
18
+ /**
19
+ * Initialize the generated WebAssembly component.
20
+ *
21
+ * @param coreImports
22
+ * Things, typically functions, to pass into the component.
23
+ * @returns
24
+ * Promise that resolves to the initialized component.
25
+ */
18
26
  async function initializeWasm(coreImports) {
19
27
  try {
20
28
  return instantiate(moduleFromPath, coreImports);
package/index.d.ts CHANGED
@@ -1,5 +1,11 @@
1
- import type { ImportObject, BotConfig, DetectedSensitiveInfoEntity, SensitiveInfoEntity, EmailValidationResult, BotResult, SensitiveInfoResult, EmailValidationConfig, SensitiveInfoEntities } from "./wasm/arcjet_analyze_js_req.component.js";
2
- import type { ArcjetJsReqSensitiveInformationIdentifier } from "./wasm/interfaces/arcjet-js-req-sensitive-information-identifier.js";
3
- type DetectSensitiveInfoFunction = typeof ArcjetJsReqSensitiveInformationIdentifier.detect;
1
+ import type { ImportObject } from "./wasm/arcjet_analyze_js_req.component.js";
2
+ /**
3
+ * Initialize the generated WebAssembly component.
4
+ *
5
+ * @param coreImports
6
+ * Things, typically functions, to pass into the component.
7
+ * @returns
8
+ * Promise that resolves to the initialized component.
9
+ */
4
10
  export declare function initializeWasm(coreImports: ImportObject): Promise<import("./wasm/arcjet_analyze_js_req.component.js").Root | undefined>;
5
- export { type BotConfig, type DetectedSensitiveInfoEntity, type SensitiveInfoEntity, type EmailValidationConfig, type EmailValidationResult, type BotResult, type SensitiveInfoResult, type SensitiveInfoEntities, type DetectSensitiveInfoFunction, type ImportObject, };
11
+ export type { BotConfig, BotResult, DetectSensitiveInfoFunction, DetectedSensitiveInfoEntity, EmailValidationConfig, EmailValidationResult, ImportObject, FilterResult, SensitiveInfoEntities, SensitiveInfoEntity, SensitiveInfoResult, } from "./types.js";
package/index.js CHANGED
@@ -19,6 +19,14 @@ async function moduleFromPath(path) {
19
19
  // TODO(@wooorm-arcjet): figure out a test case that makes this throw.
20
20
  throw new Error(`Unknown path: ${path}`);
21
21
  }
22
+ /**
23
+ * Initialize the generated WebAssembly component.
24
+ *
25
+ * @param coreImports
26
+ * Things, typically functions, to pass into the component.
27
+ * @returns
28
+ * Promise that resolves to the initialized component.
29
+ */
22
30
  async function initializeWasm(coreImports) {
23
31
  try {
24
32
  // Await the instantiation to catch the failure
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcjet/analyze-wasm",
3
- "version": "1.0.0-beta.10",
3
+ "version": "1.0.0-beta.11",
4
4
  "description": "WebAssembly bindings to Arcjet's local analysis engine",
5
5
  "keywords": [
6
6
  "analyze",
@@ -45,6 +45,8 @@
45
45
  "edge-light.js",
46
46
  "index.d.ts",
47
47
  "index.js",
48
+ "types.d.ts",
49
+ "types.js",
48
50
  "workerd.d.ts",
49
51
  "workerd.js"
50
52
  ],
@@ -60,13 +62,12 @@
60
62
  },
61
63
  "dependencies": {},
62
64
  "devDependencies": {
63
- "@arcjet/eslint-config": "1.0.0-beta.10",
64
- "@arcjet/rollup-config": "1.0.0-beta.10",
65
- "@arcjet/tsconfig": "1.0.0-beta.10",
65
+ "@arcjet/eslint-config": "1.0.0-beta.11",
66
+ "@arcjet/rollup-config": "1.0.0-beta.11",
66
67
  "@bytecodealliance/jco": "1.5.0",
67
- "@rollup/wasm-node": "4.46.2",
68
- "@types/node": "18.18.0",
69
- "eslint": "9.32.0",
68
+ "@rollup/wasm-node": "4.50.0",
69
+ "@types/node": "24.3.0",
70
+ "eslint": "9.34.0",
70
71
  "typescript": "5.9.2"
71
72
  },
72
73
  "publishConfig": {
package/types.d.ts ADDED
@@ -0,0 +1,73 @@
1
+ import type { BotConfig as GeneratedBotConfig, BotResult as GeneratedBotResult, DetectedSensitiveInfoEntity as GeneratedDetectedSensitiveInfoEntity, EmailValidationConfig as GeneratedEmailValidationConfig, EmailValidationResult as GeneratedEmailValidationResult, ImportObject as GeneratedImportObject, FilterResult as GeneratedFilterResult, SensitiveInfoEntities as GeneratedSensitiveInfoEntities, SensitiveInfoEntity as GeneratedSensitiveInfoEntity, SensitiveInfoResult as GeneratedSensitiveInfoResult } from "./wasm/arcjet_analyze_js_req.component.js";
2
+ import type { ArcjetJsReqSensitiveInformationIdentifier } from "./wasm/interfaces/arcjet-js-req-sensitive-information-identifier.js";
3
+ /**
4
+ * Configuration for bot detection.
5
+ * Generated from the WebAssembly component.
6
+ */
7
+ export type BotConfig = GeneratedBotConfig;
8
+ /**
9
+ * Result of bot detection.
10
+ * Generated from the WebAssembly component.
11
+ */
12
+ export type BotResult = GeneratedBotResult;
13
+ /**
14
+ * Function signature for custom entity detection from JavaScript.
15
+ *
16
+ * Generated from the WebAssembly component.
17
+ *
18
+ * This signature corresponds to similar functions from `@arcjet/redact-wasm`
19
+ * and `@arcjet/redact`.
20
+ *
21
+ * @param tokens
22
+ * Tokens to detect in.
23
+ * @returns
24
+ * Array of `undefined` for tokens that are not sensitive or a `string` used as
25
+ * a label for sensitive info.
26
+ */
27
+ export type DetectSensitiveInfoFunction = typeof ArcjetJsReqSensitiveInformationIdentifier.detect;
28
+ /**
29
+ * Span of sensitive info,
30
+ * with `start` and `end` fields relating to the input value,
31
+ * and an `identifiedType` tag for its kind.
32
+ * Generated from the WebAssembly component.
33
+ */
34
+ export type DetectedSensitiveInfoEntity = GeneratedDetectedSensitiveInfoEntity;
35
+ /**
36
+ * Configuration for email validation.
37
+ * Generated from the WebAssembly component.
38
+ */
39
+ export type EmailValidationConfig = GeneratedEmailValidationConfig;
40
+ /**
41
+ * Result of email validation.
42
+ * Generated from the WebAssembly component.
43
+ */
44
+ export type EmailValidationResult = GeneratedEmailValidationResult;
45
+ /**
46
+ * Result of a filter call.
47
+ * Generated from the WebAssembly component.
48
+ */
49
+ export type FilterResult = GeneratedFilterResult;
50
+ /**
51
+ * Object representing the import structure.
52
+ * These are things that can be passed *into* the WebAssembly.
53
+ * Generated from the WebAssembly component.
54
+ */
55
+ export type ImportObject = GeneratedImportObject;
56
+ /**
57
+ * Configuration for sensitive info detection.
58
+ * Generated from the WebAssembly component.
59
+ */
60
+ export type SensitiveInfoEntities = GeneratedSensitiveInfoEntities;
61
+ /**
62
+ * Kind of sensitive info.
63
+ * Consists of each of the tags that can detect be detected natively
64
+ * and a custom tag for values detected from JavaScript.
65
+ * Generated from the WebAssembly component.
66
+ */
67
+ export type SensitiveInfoEntity = GeneratedSensitiveInfoEntity;
68
+ /**
69
+ * Result of sensitive info detection.
70
+ * Generated from the WebAssembly component.
71
+ */
72
+ export type SensitiveInfoResult = GeneratedSensitiveInfoResult;
73
+ export {};
package/types.js ADDED
@@ -0,0 +1 @@
1
+
@@ -79,6 +79,10 @@ export interface BotResult {
79
79
  verified: boolean,
80
80
  spoofed: boolean,
81
81
  }
82
+ export interface FilterResult {
83
+ allowed: boolean,
84
+ matchedExpressions: Array<string>,
85
+ }
82
86
  import { ArcjetJsReqBotIdentifier } from './interfaces/arcjet-js-req-bot-identifier.js';
83
87
  import { ArcjetJsReqEmailValidatorOverrides } from './interfaces/arcjet-js-req-email-validator-overrides.js';
84
88
  import { ArcjetJsReqSensitiveInformationIdentifier } from './interfaces/arcjet-js-req-sensitive-information-identifier.js';
@@ -91,6 +95,7 @@ export interface ImportObject {
91
95
  }
92
96
  export interface Root {
93
97
  detectBot(request: string, options: BotConfig): BotResult,
98
+ matchFilters(request: string, expressions: Array<string>, allowIfMatch: boolean): FilterResult,
94
99
  generateFingerprint(request: string, characteristics: Array<string>): string,
95
100
  validateCharacteristics(request: string, characteristics: Array<string>): void,
96
101
  isValidEmail(candidate: string, options: EmailValidationConfig): EmailValidationResult,
@@ -328,9 +328,9 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
328
328
  },
329
329
  }));
330
330
  postReturn0 = exports1['cabi_post_detect-bot'];
331
- postReturn1 = exports1['cabi_post_generate-fingerprint'];
332
- postReturn2 = exports1['cabi_post_validate-characteristics'];
333
- postReturn3 = exports1['cabi_post_is-valid-email'];
331
+ postReturn1 = exports1['cabi_post_is-valid-email'];
332
+ postReturn2 = exports1['cabi_post_generate-fingerprint'];
333
+ postReturn3 = exports1['cabi_post_validate-characteristics'];
334
334
  postReturn4 = exports1['cabi_post_detect-sensitive-info'];
335
335
 
336
336
  function detectBot(arg0, arg1) {
@@ -443,6 +443,65 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
443
443
  return retVal.val;
444
444
  }
445
445
 
446
+ function matchFilters(arg0, arg1, arg2) {
447
+ var ptr0 = utf8Encode(arg0, realloc0, memory0);
448
+ var len0 = utf8EncodedLen;
449
+ var vec2 = arg1;
450
+ var len2 = vec2.length;
451
+ var result2 = realloc0(0, 0, 4, len2 * 8);
452
+ for (let i = 0; i < vec2.length; i++) {
453
+ const e = vec2[i];
454
+ const base = result2 + i * 8;var ptr1 = utf8Encode(e, realloc0, memory0);
455
+ var len1 = utf8EncodedLen;
456
+ dataView(memory0).setInt32(base + 4, len1, true);
457
+ dataView(memory0).setInt32(base + 0, ptr1, true);
458
+ }
459
+ const ret = exports1['match-filters'](ptr0, len0, result2, len2, arg2 ? 1 : 0);
460
+ let variant7;
461
+ switch (dataView(memory0).getUint8(ret + 0, true)) {
462
+ case 0: {
463
+ var bool3 = dataView(memory0).getUint8(ret + 4, true);
464
+ var len5 = dataView(memory0).getInt32(ret + 12, true);
465
+ var base5 = dataView(memory0).getInt32(ret + 8, true);
466
+ var result5 = [];
467
+ for (let i = 0; i < len5; i++) {
468
+ const base = base5 + i * 8;
469
+ var ptr4 = dataView(memory0).getInt32(base + 0, true);
470
+ var len4 = dataView(memory0).getInt32(base + 4, true);
471
+ var result4 = utf8Decoder.decode(new Uint8Array(memory0.buffer, ptr4, len4));
472
+ result5.push(result4);
473
+ }
474
+ variant7= {
475
+ tag: 'ok',
476
+ val: {
477
+ allowed: bool3 == 0 ? false : (bool3 == 1 ? true : throwInvalidBool()),
478
+ matchedExpressions: result5,
479
+ }
480
+ };
481
+ break;
482
+ }
483
+ case 1: {
484
+ var ptr6 = dataView(memory0).getInt32(ret + 4, true);
485
+ var len6 = dataView(memory0).getInt32(ret + 8, true);
486
+ var result6 = utf8Decoder.decode(new Uint8Array(memory0.buffer, ptr6, len6));
487
+ variant7= {
488
+ tag: 'err',
489
+ val: result6
490
+ };
491
+ break;
492
+ }
493
+ default: {
494
+ throw new TypeError('invalid variant discriminant for expected');
495
+ }
496
+ }
497
+ const retVal = variant7;
498
+ postReturn1(ret);
499
+ if (typeof retVal === 'object' && retVal.tag === 'err') {
500
+ throw new ComponentError(retVal.val);
501
+ }
502
+ return retVal.val;
503
+ }
504
+
446
505
  function generateFingerprint(arg0, arg1) {
447
506
  var ptr0 = utf8Encode(arg0, realloc0, memory0);
448
507
  var len0 = utf8EncodedLen;
@@ -484,7 +543,7 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
484
543
  }
485
544
  }
486
545
  const retVal = variant5;
487
- postReturn1(ret);
546
+ postReturn2(ret);
488
547
  if (typeof retVal === 'object' && retVal.tag === 'err') {
489
548
  throw new ComponentError(retVal.val);
490
549
  }
@@ -529,7 +588,7 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
529
588
  }
530
589
  }
531
590
  const retVal = variant4;
532
- postReturn2(ret);
591
+ postReturn3(ret);
533
592
  if (typeof retVal === 'object' && retVal.tag === 'err') {
534
593
  throw new ComponentError(retVal.val);
535
594
  }
@@ -642,7 +701,7 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
642
701
  }
643
702
  }
644
703
  const retVal = variant12;
645
- postReturn3(ret);
704
+ postReturn1(ret);
646
705
  if (typeof retVal === 'object' && retVal.tag === 'err') {
647
706
  throw new ComponentError(retVal.val);
648
707
  }
@@ -872,7 +931,7 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
872
931
  return retVal;
873
932
  }
874
933
 
875
- return { detectBot, detectSensitiveInfo, generateFingerprint, isValidEmail, validateCharacteristics, };
934
+ return { detectBot, detectSensitiveInfo, generateFingerprint, isValidEmail, matchFilters, validateCharacteristics, };
876
935
  })();
877
936
  let promise, resolve, reject;
878
937
  function runNext (value) {
package/workerd.d.ts CHANGED
@@ -1,5 +1,11 @@
1
- import type { ImportObject, BotConfig, DetectedSensitiveInfoEntity, SensitiveInfoEntity, EmailValidationResult, BotResult, SensitiveInfoResult, EmailValidationConfig, SensitiveInfoEntities } from "./wasm/arcjet_analyze_js_req.component.js";
2
- import type { ArcjetJsReqSensitiveInformationIdentifier } from "./wasm/interfaces/arcjet-js-req-sensitive-information-identifier.js";
3
- type DetectSensitiveInfoFunction = typeof ArcjetJsReqSensitiveInformationIdentifier.detect;
1
+ import type { ImportObject } from "./wasm/arcjet_analyze_js_req.component.js";
2
+ /**
3
+ * Initialize the generated WebAssembly component.
4
+ *
5
+ * @param coreImports
6
+ * Things, typically functions, to pass into the component.
7
+ * @returns
8
+ * Promise that resolves to the initialized component.
9
+ */
4
10
  export declare function initializeWasm(coreImports: ImportObject): Promise<import("./wasm/arcjet_analyze_js_req.component.js").Root | undefined>;
5
- export { type BotConfig, type DetectedSensitiveInfoEntity, type SensitiveInfoEntity, type EmailValidationConfig, type EmailValidationResult, type BotResult, type SensitiveInfoResult, type SensitiveInfoEntities, type DetectSensitiveInfoFunction, type ImportObject, };
11
+ export type { BotConfig, BotResult, DetectSensitiveInfoFunction, DetectedSensitiveInfoEntity, EmailValidationConfig, EmailValidationResult, ImportObject, FilterResult, SensitiveInfoEntities, SensitiveInfoEntity, SensitiveInfoResult, } from "./types.js";
package/workerd.js CHANGED
@@ -15,6 +15,14 @@ async function moduleFromPath(path) {
15
15
  }
16
16
  throw new Error(`Unknown path: ${path}`);
17
17
  }
18
+ /**
19
+ * Initialize the generated WebAssembly component.
20
+ *
21
+ * @param coreImports
22
+ * Things, typically functions, to pass into the component.
23
+ * @returns
24
+ * Promise that resolves to the initialized component.
25
+ */
18
26
  async function initializeWasm(coreImports) {
19
27
  try {
20
28
  // Await the instantiation to catch the failure