@re2tools/re2-wasm-esm 1.0.0 → 1.0.2
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.node.d.ts +14 -0
- package/dist/index.node.d.ts.map +1 -0
- package/dist/index.node.js +41 -0
- package/dist/loader-node.d.ts +10 -0
- package/dist/loader-node.d.ts.map +1 -0
- package/dist/loader-node.js +16 -0
- package/dist/loader.d.ts +22 -0
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +57 -43
- package/package.json +3 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node entry point. Uses loader-node.js (which has import.meta.url) so the
|
|
3
|
+
* browser build (index.js) stays parseable by Webpack.
|
|
4
|
+
*/
|
|
5
|
+
export { getModule, whenReady, createLoader, setReady, isResolved } from "./loader.js";
|
|
6
|
+
export type { Re2WasmModule, NodeGlueContext, RunNodeGlue } from "./loader.js";
|
|
7
|
+
export type { RE2ExecArray, RE2MatchArray } from "./re2-wasm/re2.js";
|
|
8
|
+
export declare function init(options?: {
|
|
9
|
+
wasmUrl?: string;
|
|
10
|
+
glueUrl?: string;
|
|
11
|
+
baseUrl?: string;
|
|
12
|
+
}): Promise<void>;
|
|
13
|
+
export declare function getRE2(): (new (pattern: string | RegExp, flags?: string) => import("./re2-wasm/re2.js").RE2);
|
|
14
|
+
//# sourceMappingURL=index.node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../src/index.node.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACvF,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/E,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAcrE,wBAAsB,IAAI,CAAC,OAAO,CAAC,EAAE;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgChB;AAED,wBAAgB,MAAM,IAAI,CAAC,KACzB,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,KAAK,CAAC,EAAE,MAAM,KACX,OAAO,mBAAmB,EAAE,GAAG,CAAC,CAUpC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node entry point. Uses loader-node.js (which has import.meta.url) so the
|
|
3
|
+
* browser build (index.js) stays parseable by Webpack.
|
|
4
|
+
*/
|
|
5
|
+
export { getModule, whenReady, createLoader, setReady, isResolved } from "./loader.js";
|
|
6
|
+
import { createLoader, setReady, isResolved, resolvedRE2Class, } from "./loader.js";
|
|
7
|
+
import { getNodeDirname, runNodeGlue } from "./loader-node.js";
|
|
8
|
+
const isNode = typeof process !== "undefined" &&
|
|
9
|
+
typeof process.versions?.node === "string";
|
|
10
|
+
export async function init(options) {
|
|
11
|
+
if (isResolved())
|
|
12
|
+
return;
|
|
13
|
+
if (isNode) {
|
|
14
|
+
const path = await import("path");
|
|
15
|
+
const { readFile } = await import("fs/promises");
|
|
16
|
+
const __dirname = getNodeDirname();
|
|
17
|
+
const wasmPath = path.join(__dirname, "re2.wasm");
|
|
18
|
+
const gluePath = path.join(__dirname, "re2-glue.js");
|
|
19
|
+
const re2ScriptPath = path.join(__dirname, "re2-wasm", "re2.js");
|
|
20
|
+
const p = createLoader(() => readFile(wasmPath).then((b) => b.buffer), () => readFile(gluePath, "utf8"), {
|
|
21
|
+
nodeContext: {
|
|
22
|
+
__dirname,
|
|
23
|
+
__filename: gluePath,
|
|
24
|
+
wasmPath,
|
|
25
|
+
re2ScriptPath,
|
|
26
|
+
},
|
|
27
|
+
runGlue: runNodeGlue,
|
|
28
|
+
}, undefined);
|
|
29
|
+
setReady(p);
|
|
30
|
+
await p;
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const { init: browserInit } = await import("./loader.js");
|
|
34
|
+
return browserInit(options);
|
|
35
|
+
}
|
|
36
|
+
export function getRE2() {
|
|
37
|
+
if (!resolvedRE2Class) {
|
|
38
|
+
throw new Error("RE2 not ready. Call await init() before using getRE2().");
|
|
39
|
+
}
|
|
40
|
+
return resolvedRE2Class;
|
|
41
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node-only helpers. This file uses import.meta.url and is only loaded in Node
|
|
3
|
+
* (via the "node" export). Do not import from bundlers building for browser.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getNodeDirname(): string;
|
|
6
|
+
export declare function runNodeGlue(scriptText: string, ctx: {
|
|
7
|
+
__dirname: string;
|
|
8
|
+
__filename: string;
|
|
9
|
+
}): void;
|
|
10
|
+
//# sourceMappingURL=loader-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader-node.d.ts","sourceRoot":"","sources":["../src/loader-node.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,wBAAgB,WAAW,CACzB,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAC7C,IAAI,CAKN"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node-only helpers. This file uses import.meta.url and is only loaded in Node
|
|
3
|
+
* (via the "node" export). Do not import from bundlers building for browser.
|
|
4
|
+
*/
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
6
|
+
import * as path from "path";
|
|
7
|
+
import { createRequire } from "module";
|
|
8
|
+
export function getNodeDirname() {
|
|
9
|
+
return path.dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
}
|
|
11
|
+
export function runNodeGlue(scriptText, ctx) {
|
|
12
|
+
const req = createRequire(import.meta.url);
|
|
13
|
+
globalThis.require = req;
|
|
14
|
+
const fn = new Function("__dirname", "__filename", scriptText);
|
|
15
|
+
fn(ctx.__dirname, ctx.__filename);
|
|
16
|
+
}
|
package/dist/loader.d.ts
CHANGED
|
@@ -9,6 +9,9 @@ declare global {
|
|
|
9
9
|
}
|
|
10
10
|
var Module: Record<string, unknown> | undefined;
|
|
11
11
|
}
|
|
12
|
+
/** Used by the Node entry to set ready after createLoader. */
|
|
13
|
+
export declare function setReady(p: Promise<Record<string, unknown>> | null): void;
|
|
14
|
+
export declare function isResolved(): boolean;
|
|
12
15
|
/** Set by init(): the RE2 class (vendored from re2-wasm). */
|
|
13
16
|
export declare let resolvedRE2Class: unknown;
|
|
14
17
|
export interface Re2WasmModule {
|
|
@@ -30,6 +33,25 @@ export interface Re2WasmModule {
|
|
|
30
33
|
};
|
|
31
34
|
};
|
|
32
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Load and run the RE2 WASM runtime (vendored wasm + glue from re2-wasm).
|
|
38
|
+
* In Node we preload wasm into Module.wasmBinary so the Emscripten glue uses sync
|
|
39
|
+
* instantiation and onRuntimeInitialized runs. In browser we use async instantiateWasm.
|
|
40
|
+
*/
|
|
41
|
+
export interface NodeGlueContext {
|
|
42
|
+
__dirname: string;
|
|
43
|
+
__filename: string;
|
|
44
|
+
wasmPath: string;
|
|
45
|
+
re2ScriptPath: string;
|
|
46
|
+
}
|
|
47
|
+
export type RunNodeGlue = (scriptText: string, ctx: {
|
|
48
|
+
__dirname: string;
|
|
49
|
+
__filename: string;
|
|
50
|
+
}) => void;
|
|
51
|
+
export declare function createLoader(getWasmBuffer: () => Promise<ArrayBuffer>, getGlueScript: () => Promise<string>, nodeOptions?: {
|
|
52
|
+
nodeContext: NodeGlueContext;
|
|
53
|
+
runGlue: RunNodeGlue;
|
|
54
|
+
}, re2ScriptUrl?: string): Promise<Record<string, unknown>>;
|
|
33
55
|
/**
|
|
34
56
|
* Initialize the RE2 WASM runtime. Must be called before using RE2.
|
|
35
57
|
*
|
package/dist/loader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAClC;IAED,IAAI,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;CACjD;AAYD,6DAA6D;AAC7D,eAAO,IAAI,gBAAgB,EAAE,OAAc,CAAC;AAE5C,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,KACV,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,OAAO,EACnB,SAAS,EAAE,OAAO,EAClB,MAAM,EAAE,OAAO,KACZ;QACH,EAAE,IAAI,OAAO,CAAC;QACd,KAAK,IAAI,MAAM,CAAC;QAChB,OAAO,IAAI,MAAM,CAAC;QAClB,KAAK,CACH,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,kBAAkB,EAAE,OAAO,GAC1B;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAA;SAAE,CAAC;QACpE,mBAAmB,IAAI;YAAE,IAAI,IAAI;gBAAE,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;gBAAC,IAAI,IAAI,MAAM,CAAA;aAAE,CAAC;YAAC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAC;KACzG,CAAC;CACH;
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAClC;IAED,IAAI,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;CACjD;AAYD,8DAA8D;AAC9D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,IAAI,GAAG,IAAI,CAEzE;AAED,wBAAgB,UAAU,IAAI,OAAO,CAEpC;AAED,6DAA6D;AAC7D,eAAO,IAAI,gBAAgB,EAAE,OAAc,CAAC;AAE5C,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,KACV,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,OAAO,EACnB,SAAS,EAAE,OAAO,EAClB,MAAM,EAAE,OAAO,KACZ;QACH,EAAE,IAAI,OAAO,CAAC;QACd,KAAK,IAAI,MAAM,CAAC;QAChB,OAAO,IAAI,MAAM,CAAC;QAClB,KAAK,CACH,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,kBAAkB,EAAE,OAAO,GAC1B;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAA;SAAE,CAAC;QACpE,mBAAmB,IAAI;YAAE,IAAI,IAAI;gBAAE,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;gBAAC,IAAI,IAAI,MAAM,CAAA;aAAE,CAAC;YAAC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAC;KACzG,CAAC;CACH;AAkBD;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,WAAW,GAAG,CACxB,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,KAC3C,IAAI,CAAC;AAEV,wBAAgB,YAAY,CAC1B,aAAa,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,EACzC,aAAa,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,EACpC,WAAW,CAAC,EAAE;IAAE,WAAW,EAAE,eAAe,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE,EACpE,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAuFlC;AAED;;;;GAIG;AACH,wBAAsB,IAAI,CAAC,OAAO,CAAC,EAAE;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,IAAI,CAAC,CAqChB;AAED,wBAAgB,SAAS,IAAI,aAAa,CAOzC;AAED,wBAAgB,SAAS,IAAI,OAAO,CAAC,aAAa,CAAC,CAMlD"}
|
package/dist/loader.js
CHANGED
|
@@ -9,39 +9,58 @@ const isNode = typeof process !== "undefined" &&
|
|
|
9
9
|
typeof process.versions.node === "string";
|
|
10
10
|
let ready = null;
|
|
11
11
|
let resolvedModule = null;
|
|
12
|
+
/** Used by the Node entry to set ready after createLoader. */
|
|
13
|
+
export function setReady(p) {
|
|
14
|
+
ready = p;
|
|
15
|
+
}
|
|
16
|
+
export function isResolved() {
|
|
17
|
+
return resolvedModule != null;
|
|
18
|
+
}
|
|
12
19
|
/** Set by init(): the RE2 class (vendored from re2-wasm). */
|
|
13
20
|
export let resolvedRE2Class = null;
|
|
14
21
|
/**
|
|
15
22
|
* Resolve base URL for WASM and glue script (browser).
|
|
23
|
+
* Uses document.currentScript so the built file is parseable by Webpack (no import.meta).
|
|
16
24
|
*/
|
|
17
25
|
function getBaseUrl() {
|
|
18
|
-
if (typeof
|
|
19
|
-
|
|
26
|
+
if (typeof document !== "undefined" &&
|
|
27
|
+
document.currentScript &&
|
|
28
|
+
"src" in document.currentScript) {
|
|
29
|
+
const u = document.currentScript.src;
|
|
20
30
|
return u.slice(0, u.lastIndexOf("/") + 1);
|
|
21
31
|
}
|
|
22
32
|
return "";
|
|
23
33
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
* In Node we preload wasm into Module.wasmBinary so the Emscripten glue uses sync
|
|
27
|
-
* instantiation and onRuntimeInitialized runs. In browser we use async instantiateWasm.
|
|
28
|
-
*/
|
|
29
|
-
function createLoader(getWasmBuffer, getGlueScript, nodeGlueContext) {
|
|
34
|
+
export function createLoader(getWasmBuffer, getGlueScript, nodeOptions, re2ScriptUrl) {
|
|
35
|
+
const nodeGlueContext = nodeOptions != null ? nodeOptions.nodeContext : undefined;
|
|
30
36
|
return new Promise((resolve, rej) => {
|
|
31
37
|
function onReady() {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
// the loader's dynamic import runs after the current sync glue stack.
|
|
38
|
+
const g = globalThis.Module;
|
|
39
|
+
resolvedModule = g !== undefined && g !== null ? g : Module;
|
|
35
40
|
const doResolve = () => {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
const loadRe2 = (urlOrPath, isPath) => {
|
|
42
|
+
const href = isPath
|
|
43
|
+
? (async () => {
|
|
44
|
+
const { pathToFileURL } = await import("url");
|
|
45
|
+
return pathToFileURL(urlOrPath).href;
|
|
46
|
+
})()
|
|
47
|
+
: Promise.resolve(urlOrPath);
|
|
48
|
+
href.then((h) => import(/* @vite-ignore */ h)
|
|
49
|
+
.then((m) => {
|
|
50
|
+
resolvedRE2Class = m.RE2;
|
|
51
|
+
resolve(resolvedModule);
|
|
52
|
+
})
|
|
53
|
+
.catch(rej));
|
|
54
|
+
};
|
|
55
|
+
if (nodeGlueContext != null && nodeGlueContext.re2ScriptPath) {
|
|
56
|
+
loadRe2(nodeGlueContext.re2ScriptPath, true);
|
|
57
|
+
}
|
|
58
|
+
else if (re2ScriptUrl) {
|
|
59
|
+
loadRe2(re2ScriptUrl, false);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
loadRe2("./re2-wasm/re2.js", false);
|
|
63
|
+
}
|
|
45
64
|
};
|
|
46
65
|
queueMicrotask(doResolve);
|
|
47
66
|
}
|
|
@@ -66,14 +85,11 @@ function createLoader(getWasmBuffer, getGlueScript, nodeGlueContext) {
|
|
|
66
85
|
globalThis.Module = Module;
|
|
67
86
|
const runGlue = async (scriptText) => {
|
|
68
87
|
try {
|
|
69
|
-
if (
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
fn(nodeGlueContext.__dirname, nodeGlueContext.__filename);
|
|
75
|
-
// Emscripten glue can overwrite Module['onRuntimeInitialized'] before doRun();
|
|
76
|
-
// invoke our callback now that the runtime is ready.
|
|
88
|
+
if (nodeOptions != null && nodeOptions.runGlue) {
|
|
89
|
+
nodeOptions.runGlue(scriptText, {
|
|
90
|
+
__dirname: nodeGlueContext.__dirname,
|
|
91
|
+
__filename: nodeGlueContext.__filename,
|
|
92
|
+
});
|
|
77
93
|
onReady();
|
|
78
94
|
}
|
|
79
95
|
else {
|
|
@@ -85,7 +101,7 @@ function createLoader(getWasmBuffer, getGlueScript, nodeGlueContext) {
|
|
|
85
101
|
rej(e);
|
|
86
102
|
}
|
|
87
103
|
};
|
|
88
|
-
if (
|
|
104
|
+
if (nodeGlueContext) {
|
|
89
105
|
getWasmBuffer()
|
|
90
106
|
.then((buffer) => {
|
|
91
107
|
Module.wasmBinary = buffer;
|
|
@@ -108,23 +124,21 @@ export async function init(options) {
|
|
|
108
124
|
if (resolvedModule)
|
|
109
125
|
return;
|
|
110
126
|
if (isNode) {
|
|
111
|
-
|
|
112
|
-
const { fileURLToPath } = await import("url");
|
|
113
|
-
const path = await import("path");
|
|
114
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
115
|
-
const __dirname = path.dirname(__filename);
|
|
116
|
-
const wasmPath = path.join(__dirname, "re2.wasm");
|
|
117
|
-
const gluePath = path.join(__dirname, "re2-glue.js");
|
|
118
|
-
ready = createLoader(() => readFile(wasmPath).then((b) => b.buffer), () => readFile(gluePath, "utf8"), { __dirname, __filename: gluePath, wasmPath });
|
|
119
|
-
await ready;
|
|
120
|
-
return;
|
|
127
|
+
throw new Error("This is the browser build of @re2tools/re2-wasm-esm. In Node, use the package's 'node' export so your resolver serves dist/index.node.js.");
|
|
121
128
|
}
|
|
122
129
|
if (isBrowser) {
|
|
123
130
|
if (!ready) {
|
|
124
|
-
const base = options
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
131
|
+
const base = options != null && options.baseUrl !== undefined
|
|
132
|
+
? options.baseUrl
|
|
133
|
+
: getBaseUrl();
|
|
134
|
+
const wasmUrl = options != null && options.wasmUrl !== undefined
|
|
135
|
+
? options.wasmUrl
|
|
136
|
+
: base + "re2.wasm";
|
|
137
|
+
const glueUrl = options != null && options.glueUrl !== undefined
|
|
138
|
+
? options.glueUrl
|
|
139
|
+
: base + "re2-glue.js";
|
|
140
|
+
const re2ScriptUrl = base ? base + "re2-wasm/re2.js" : undefined;
|
|
141
|
+
ready = createLoader(() => fetch(wasmUrl).then((r) => r.arrayBuffer()), () => fetch(glueUrl).then((r) => r.text()), undefined, re2ScriptUrl);
|
|
128
142
|
}
|
|
129
143
|
await ready;
|
|
130
144
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@re2tools/re2-wasm-esm",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Google RE2 as WASM - ESM build with browser support (async init)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
+
"node": "./dist/index.node.js",
|
|
11
12
|
"import": "./dist/index.js",
|
|
13
|
+
"default": "./dist/index.js",
|
|
12
14
|
"types": "./dist/index.d.ts"
|
|
13
15
|
}
|
|
14
16
|
},
|