@firela/pii-redactor 0.1.1 → 0.1.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/index-node.mjs +19 -0
- package/package.json +8 -2
- package/pii_redactor.opt.wasm +0 -0
package/index-node.mjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// ESM entry for Node.js consumers (Phase 74 UAT gap-closure, test 8).
|
|
2
|
+
//
|
|
3
|
+
// Why this exists: the isomorphic loaders branch ONLY at module-load. The CJS
|
|
4
|
+
// loader (index-node.cjs) reads the wasm via fs + WebAssembly.instantiate(bytes);
|
|
5
|
+
// the Worker loader (index-worker.js) does a static `import mod from '*.wasm'`,
|
|
6
|
+
// which is valid only under a Cloudflare Worker bundler — Node ESM `import` of
|
|
7
|
+
// the Worker entry throws ERR_UNKNOWN_FILE_EXTENSION. package.json routes Node
|
|
8
|
+
// ESM resolution here via exports.node.import.
|
|
9
|
+
//
|
|
10
|
+
// We bridge to the PROVEN CJS loader with createRequire instead of duplicating
|
|
11
|
+
// the FFI cycle — index-node.cjs locates the wasm via path.join(__dirname, ...),
|
|
12
|
+
// and __dirname inside that .cjs is its own directory, so the wasm resolves
|
|
13
|
+
// correctly regardless of how the .cjs was required. The parse/detect contract
|
|
14
|
+
// is therefore byte-identical to the CommonJS path (no second implementation).
|
|
15
|
+
import { createRequire } from 'node:module';
|
|
16
|
+
|
|
17
|
+
const require = createRequire(import.meta.url);
|
|
18
|
+
|
|
19
|
+
export const { parse, detect } = require('./index-node.cjs');
|
package/package.json
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firela/pii-redactor",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "firela parser/sanitizer WASM module — isomorphic Node.js + Cloudflare Worker loader (ADR-0101 compiled-only).",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/fire-zu/firela-sdk.git"
|
|
8
|
+
},
|
|
5
9
|
"type": "module",
|
|
6
10
|
"main": "./index-node.cjs",
|
|
7
11
|
"module": "./index-worker.js",
|
|
8
12
|
"exports": {
|
|
9
13
|
".": {
|
|
10
14
|
"node": {
|
|
11
|
-
"require": "./index-node.cjs"
|
|
15
|
+
"require": "./index-node.cjs",
|
|
16
|
+
"import": "./index-node.mjs"
|
|
12
17
|
},
|
|
13
18
|
"worker": "./index-worker.js",
|
|
14
19
|
"default": "./index-worker.js"
|
|
@@ -17,6 +22,7 @@
|
|
|
17
22
|
},
|
|
18
23
|
"files": [
|
|
19
24
|
"index-node.cjs",
|
|
25
|
+
"index-node.mjs",
|
|
20
26
|
"index-worker.js",
|
|
21
27
|
"index.d.ts",
|
|
22
28
|
"pii_redactor.opt.wasm"
|
package/pii_redactor.opt.wasm
CHANGED
|
Binary file
|