@arcjet/analyze
Advanced tools
Comparing version 1.0.0-alpha.2 to 1.0.0-alpha.3
26
index.js
@@ -18,16 +18,16 @@ import initWasm, { detect_bot, generate_fingerprint, is_valid_email } from './wasm/arcjet_analyze_js_req.js'; | ||
if (state === "uninitialized") { | ||
let wasmModule; | ||
// We use `NEXT_RUNTIME` env var to DCE the Node/Browser code in the `else` block | ||
// possible values: "edge" | "nodejs" | undefined | ||
if (process.env["NEXT_RUNTIME"] === "edge") { | ||
const mod = await import( | ||
// @ts-expect-error | ||
'./wasm/arcjet_analyze_js_req_bg.wasm?module'); | ||
wasmModule = mod.default; | ||
} | ||
else { | ||
const { wasm } = await import('./wasm/arcjet.wasm.js'); | ||
wasmModule = await WebAssembly.compile(wasm); | ||
} | ||
try { | ||
let wasmModule; | ||
// We use `NEXT_RUNTIME` env var to DCE the Node/Browser code in the `else` block | ||
// possible values: "edge" | "nodejs" | undefined | ||
if (process.env["NEXT_RUNTIME"] === "edge") { | ||
const mod = await import( | ||
// @ts-expect-error | ||
'./wasm/arcjet_analyze_js_req_bg.wasm?module'); | ||
wasmModule = mod.default; | ||
} | ||
else { | ||
const { wasm } = await import('./wasm/arcjet.wasm.js'); | ||
wasmModule = await WebAssembly.compile(await wasm()); | ||
} | ||
await initWasm(wasmModule); | ||
@@ -34,0 +34,0 @@ state = "initialized"; |
28
index.ts
@@ -47,17 +47,17 @@ import initWasm, { | ||
if (state === "uninitialized") { | ||
let wasmModule: WebAssembly.Module; | ||
// We use `NEXT_RUNTIME` env var to DCE the Node/Browser code in the `else` block | ||
// possible values: "edge" | "nodejs" | undefined | ||
if (process.env["NEXT_RUNTIME"] === "edge") { | ||
const mod = await import( | ||
// @ts-expect-error | ||
"./wasm/arcjet_analyze_js_req_bg.wasm?module" | ||
); | ||
wasmModule = mod.default; | ||
} else { | ||
const { wasm } = await import("./wasm/arcjet.wasm.js"); | ||
wasmModule = await WebAssembly.compile(wasm); | ||
} | ||
try { | ||
let wasmModule: WebAssembly.Module; | ||
// We use `NEXT_RUNTIME` env var to DCE the Node/Browser code in the `else` block | ||
// possible values: "edge" | "nodejs" | undefined | ||
if (process.env["NEXT_RUNTIME"] === "edge") { | ||
const mod = await import( | ||
// @ts-expect-error | ||
"./wasm/arcjet_analyze_js_req_bg.wasm?module" | ||
); | ||
wasmModule = mod.default; | ||
} else { | ||
const { wasm } = await import("./wasm/arcjet.wasm.js"); | ||
wasmModule = await WebAssembly.compile(await wasm()); | ||
} | ||
try { | ||
await initWasm(wasmModule); | ||
@@ -64,0 +64,0 @@ state = "initialized"; |
{ | ||
"name": "@arcjet/analyze", | ||
"version": "1.0.0-alpha.2", | ||
"version": "1.0.0-alpha.3", | ||
"description": "Arcjet local analysis engine", | ||
@@ -31,2 +31,3 @@ "license": "Apache-2.0", | ||
"lint": "eslint .", | ||
"pretest": "npm run build", | ||
"test": "NODE_OPTIONS=--experimental-vm-modules jest --passWithNoTests" | ||
@@ -38,12 +39,12 @@ }, | ||
"dependencies": { | ||
"@arcjet/logger": "1.0.0-alpha.2" | ||
"@arcjet/logger": "1.0.0-alpha.3" | ||
}, | ||
"devDependencies": { | ||
"@arcjet/eslint-config": "1.0.0-alpha.2", | ||
"@arcjet/rollup-config": "1.0.0-alpha.2", | ||
"@arcjet/tsconfig": "1.0.0-alpha.2", | ||
"@arcjet/eslint-config": "1.0.0-alpha.3", | ||
"@arcjet/rollup-config": "1.0.0-alpha.3", | ||
"@arcjet/tsconfig": "1.0.0-alpha.3", | ||
"@jest/globals": "29.7.0", | ||
"@rollup/wasm-node": "4.6.1", | ||
"@types/node": "18.18.0", | ||
"jest": "29.7.0", | ||
"rollup": "4.6.1", | ||
"typescript": "5.3.2" | ||
@@ -50,0 +51,0 @@ }, |
@@ -27,2 +27,6 @@ // @generated by wasm2module - DO NOT EDIT | ||
export const wasm: ArrayBuffer; | ||
/** | ||
* Returns an ArrayBuffer for the Arcjet Wasm binary, decoded from a base64 Data | ||
* URL. | ||
*/ | ||
export function wasm(): Promise<ArrayBuffer>; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3702432
9024
+ Added@arcjet/logger@1.0.0-alpha.3(transitive)
- Removed@arcjet/logger@1.0.0-alpha.2(transitive)
Updated@arcjet/logger@1.0.0-alpha.3