@arcjet/analyze 1.0.0-alpha.9 → 1.0.0-beta.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/README.md +9 -29
- package/index.d.ts +24 -22
- package/index.js +88 -81
- package/package.json +12 -14
- package/index.ts +0 -165
- package/wasm/arcjet.wasm.d.ts +0 -31
- package/wasm/arcjet.wasm.js +0 -38
- package/wasm/arcjet_analyze_js_req.d.ts +0 -70
- package/wasm/arcjet_analyze_js_req.js +0 -508
- package/wasm/arcjet_analyze_js_req_bg.wasm +0 -0
- package/wasm/arcjet_analyze_js_req_bg.wasm.d.ts +0 -10
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/* tslint:disable */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
/**
|
|
4
|
-
* @param {string} headers
|
|
5
|
-
* @param {string} patterns_add
|
|
6
|
-
* @param {string} patterns_remove
|
|
7
|
-
* @returns {any}
|
|
8
|
-
*/
|
|
9
|
-
export function detect_bot(headers: string, patterns_add: string, patterns_remove: string): any;
|
|
10
|
-
/**
|
|
11
|
-
* @param {string} ip
|
|
12
|
-
* @returns {string}
|
|
13
|
-
*/
|
|
14
|
-
export function generate_fingerprint(ip: string): string;
|
|
15
|
-
/**
|
|
16
|
-
* @param {string} candidate
|
|
17
|
-
* @param {EmailValidationConfig | undefined} [options]
|
|
18
|
-
* @returns {boolean}
|
|
19
|
-
*/
|
|
20
|
-
export function is_valid_email(candidate: string, options?: EmailValidationConfig): boolean;
|
|
21
|
-
|
|
22
|
-
interface EmailValidationConfig {
|
|
23
|
-
/**
|
|
24
|
-
* If `true`, requires at least 2 segments in the `domain` part of an email address
|
|
25
|
-
*
|
|
26
|
-
* @default true
|
|
27
|
-
*/
|
|
28
|
-
requireTopLevelDomain?: boolean,
|
|
29
|
-
/**
|
|
30
|
-
* If `true`, allows email addresses in the form of `example@[127.0.0.1]`
|
|
31
|
-
*
|
|
32
|
-
* @default false
|
|
33
|
-
*/
|
|
34
|
-
allowDomainLiteral?: boolean,
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
39
|
-
|
|
40
|
-
export interface InitOutput {
|
|
41
|
-
readonly memory: WebAssembly.Memory;
|
|
42
|
-
readonly detect_bot: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
43
|
-
readonly generate_fingerprint: (a: number, b: number, c: number) => void;
|
|
44
|
-
readonly is_valid_email: (a: number, b: number, c: number, d: number) => void;
|
|
45
|
-
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
46
|
-
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
47
|
-
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
48
|
-
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
52
|
-
/**
|
|
53
|
-
* Instantiates the given `module`, which can either be bytes or
|
|
54
|
-
* a precompiled `WebAssembly.Module`.
|
|
55
|
-
*
|
|
56
|
-
* @param {SyncInitInput} module
|
|
57
|
-
*
|
|
58
|
-
* @returns {InitOutput}
|
|
59
|
-
*/
|
|
60
|
-
export function initSync(module: SyncInitInput): InitOutput;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
64
|
-
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
65
|
-
*
|
|
66
|
-
* @param {InitInput | Promise<InitInput>} module_or_path
|
|
67
|
-
*
|
|
68
|
-
* @returns {Promise<InitOutput>}
|
|
69
|
-
*/
|
|
70
|
-
export default function __wbg_init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;
|
|
@@ -1,508 +0,0 @@
|
|
|
1
|
-
import { default as default1 } from '@arcjet/logger';
|
|
2
|
-
|
|
3
|
-
let wasm;
|
|
4
|
-
|
|
5
|
-
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
6
|
-
|
|
7
|
-
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
8
|
-
|
|
9
|
-
let cachedUint8Memory0 = null;
|
|
10
|
-
|
|
11
|
-
function getUint8Memory0() {
|
|
12
|
-
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
13
|
-
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
14
|
-
}
|
|
15
|
-
return cachedUint8Memory0;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function getStringFromWasm0(ptr, len) {
|
|
19
|
-
ptr = ptr >>> 0;
|
|
20
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const heap = new Array(128).fill(undefined);
|
|
24
|
-
|
|
25
|
-
heap.push(undefined, null, true, false);
|
|
26
|
-
|
|
27
|
-
let heap_next = heap.length;
|
|
28
|
-
|
|
29
|
-
function addHeapObject(obj) {
|
|
30
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
31
|
-
const idx = heap_next;
|
|
32
|
-
heap_next = heap[idx];
|
|
33
|
-
|
|
34
|
-
heap[idx] = obj;
|
|
35
|
-
return idx;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function getObject(idx) { return heap[idx]; }
|
|
39
|
-
|
|
40
|
-
function dropObject(idx) {
|
|
41
|
-
if (idx < 132) return;
|
|
42
|
-
heap[idx] = heap_next;
|
|
43
|
-
heap_next = idx;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function takeObject(idx) {
|
|
47
|
-
const ret = getObject(idx);
|
|
48
|
-
dropObject(idx);
|
|
49
|
-
return ret;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function isLikeNone(x) {
|
|
53
|
-
return x === undefined || x === null;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
let cachedFloat64Memory0 = null;
|
|
57
|
-
|
|
58
|
-
function getFloat64Memory0() {
|
|
59
|
-
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
|
60
|
-
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
61
|
-
}
|
|
62
|
-
return cachedFloat64Memory0;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
let cachedInt32Memory0 = null;
|
|
66
|
-
|
|
67
|
-
function getInt32Memory0() {
|
|
68
|
-
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
69
|
-
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
70
|
-
}
|
|
71
|
-
return cachedInt32Memory0;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
let WASM_VECTOR_LEN = 0;
|
|
75
|
-
|
|
76
|
-
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
77
|
-
|
|
78
|
-
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
79
|
-
? function (arg, view) {
|
|
80
|
-
return cachedTextEncoder.encodeInto(arg, view);
|
|
81
|
-
}
|
|
82
|
-
: function (arg, view) {
|
|
83
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
84
|
-
view.set(buf);
|
|
85
|
-
return {
|
|
86
|
-
read: arg.length,
|
|
87
|
-
written: buf.length
|
|
88
|
-
};
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
function passStringToWasm0(arg, malloc, realloc) {
|
|
92
|
-
|
|
93
|
-
if (realloc === undefined) {
|
|
94
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
95
|
-
const ptr = malloc(buf.length, 1) >>> 0;
|
|
96
|
-
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
97
|
-
WASM_VECTOR_LEN = buf.length;
|
|
98
|
-
return ptr;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
let len = arg.length;
|
|
102
|
-
let ptr = malloc(len, 1) >>> 0;
|
|
103
|
-
|
|
104
|
-
const mem = getUint8Memory0();
|
|
105
|
-
|
|
106
|
-
let offset = 0;
|
|
107
|
-
|
|
108
|
-
for (; offset < len; offset++) {
|
|
109
|
-
const code = arg.charCodeAt(offset);
|
|
110
|
-
if (code > 0x7F) break;
|
|
111
|
-
mem[ptr + offset] = code;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
if (offset !== len) {
|
|
115
|
-
if (offset !== 0) {
|
|
116
|
-
arg = arg.slice(offset);
|
|
117
|
-
}
|
|
118
|
-
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
119
|
-
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
|
120
|
-
const ret = encodeString(arg, view);
|
|
121
|
-
|
|
122
|
-
offset += ret.written;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
WASM_VECTOR_LEN = offset;
|
|
126
|
-
return ptr;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
function debugString(val) {
|
|
130
|
-
// primitive types
|
|
131
|
-
const type = typeof val;
|
|
132
|
-
if (type == 'number' || type == 'boolean' || val == null) {
|
|
133
|
-
return `${val}`;
|
|
134
|
-
}
|
|
135
|
-
if (type == 'string') {
|
|
136
|
-
return `"${val}"`;
|
|
137
|
-
}
|
|
138
|
-
if (type == 'symbol') {
|
|
139
|
-
const description = val.description;
|
|
140
|
-
if (description == null) {
|
|
141
|
-
return 'Symbol';
|
|
142
|
-
} else {
|
|
143
|
-
return `Symbol(${description})`;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
if (type == 'function') {
|
|
147
|
-
const name = val.name;
|
|
148
|
-
if (typeof name == 'string' && name.length > 0) {
|
|
149
|
-
return `Function(${name})`;
|
|
150
|
-
} else {
|
|
151
|
-
return 'Function';
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
// objects
|
|
155
|
-
if (Array.isArray(val)) {
|
|
156
|
-
const length = val.length;
|
|
157
|
-
let debug = '[';
|
|
158
|
-
if (length > 0) {
|
|
159
|
-
debug += debugString(val[0]);
|
|
160
|
-
}
|
|
161
|
-
for(let i = 1; i < length; i++) {
|
|
162
|
-
debug += ', ' + debugString(val[i]);
|
|
163
|
-
}
|
|
164
|
-
debug += ']';
|
|
165
|
-
return debug;
|
|
166
|
-
}
|
|
167
|
-
// Test for built-in
|
|
168
|
-
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
169
|
-
let className;
|
|
170
|
-
if (builtInMatches.length > 1) {
|
|
171
|
-
className = builtInMatches[1];
|
|
172
|
-
} else {
|
|
173
|
-
// Failed to match the standard '[object ClassName]'
|
|
174
|
-
return toString.call(val);
|
|
175
|
-
}
|
|
176
|
-
if (className == 'Object') {
|
|
177
|
-
// we're a user defined class or Object
|
|
178
|
-
// JSON.stringify avoids problems with cycles, and is generally much
|
|
179
|
-
// easier than looping through ownProperties of `val`.
|
|
180
|
-
try {
|
|
181
|
-
return 'Object(' + JSON.stringify(val) + ')';
|
|
182
|
-
} catch (_) {
|
|
183
|
-
return 'Object';
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
// errors
|
|
187
|
-
if (val instanceof Error) {
|
|
188
|
-
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
189
|
-
}
|
|
190
|
-
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
191
|
-
return className;
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* @param {string} headers
|
|
195
|
-
* @param {string} patterns_add
|
|
196
|
-
* @param {string} patterns_remove
|
|
197
|
-
* @returns {any}
|
|
198
|
-
*/
|
|
199
|
-
export function detect_bot(headers, patterns_add, patterns_remove) {
|
|
200
|
-
const ptr0 = passStringToWasm0(headers, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
201
|
-
const len0 = WASM_VECTOR_LEN;
|
|
202
|
-
const ptr1 = passStringToWasm0(patterns_add, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
203
|
-
const len1 = WASM_VECTOR_LEN;
|
|
204
|
-
const ptr2 = passStringToWasm0(patterns_remove, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
205
|
-
const len2 = WASM_VECTOR_LEN;
|
|
206
|
-
const ret = wasm.detect_bot(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
207
|
-
return takeObject(ret);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* @param {string} ip
|
|
212
|
-
* @returns {string}
|
|
213
|
-
*/
|
|
214
|
-
export function generate_fingerprint(ip) {
|
|
215
|
-
let deferred2_0;
|
|
216
|
-
let deferred2_1;
|
|
217
|
-
try {
|
|
218
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
219
|
-
const ptr0 = passStringToWasm0(ip, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
220
|
-
const len0 = WASM_VECTOR_LEN;
|
|
221
|
-
wasm.generate_fingerprint(retptr, ptr0, len0);
|
|
222
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
223
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
224
|
-
deferred2_0 = r0;
|
|
225
|
-
deferred2_1 = r1;
|
|
226
|
-
return getStringFromWasm0(r0, r1);
|
|
227
|
-
} finally {
|
|
228
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
229
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* @param {string} candidate
|
|
235
|
-
* @param {EmailValidationConfig | undefined} [options]
|
|
236
|
-
* @returns {boolean}
|
|
237
|
-
*/
|
|
238
|
-
export function is_valid_email(candidate, options) {
|
|
239
|
-
try {
|
|
240
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
241
|
-
const ptr0 = passStringToWasm0(candidate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
242
|
-
const len0 = WASM_VECTOR_LEN;
|
|
243
|
-
wasm.is_valid_email(retptr, ptr0, len0, isLikeNone(options) ? 0 : addHeapObject(options));
|
|
244
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
245
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
246
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
247
|
-
if (r2) {
|
|
248
|
-
throw takeObject(r1);
|
|
249
|
-
}
|
|
250
|
-
return r0 !== 0;
|
|
251
|
-
} finally {
|
|
252
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
async function __wbg_load(module, imports) {
|
|
257
|
-
if (typeof Response === 'function' && module instanceof Response) {
|
|
258
|
-
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
259
|
-
try {
|
|
260
|
-
return await WebAssembly.instantiateStreaming(module, imports);
|
|
261
|
-
|
|
262
|
-
} catch (e) {
|
|
263
|
-
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
264
|
-
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
265
|
-
|
|
266
|
-
} else {
|
|
267
|
-
throw e;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
const bytes = await module.arrayBuffer();
|
|
273
|
-
return await WebAssembly.instantiate(bytes, imports);
|
|
274
|
-
|
|
275
|
-
} else {
|
|
276
|
-
const instance = await WebAssembly.instantiate(module, imports);
|
|
277
|
-
|
|
278
|
-
if (instance instanceof WebAssembly.Instance) {
|
|
279
|
-
return { instance, module };
|
|
280
|
-
|
|
281
|
-
} else {
|
|
282
|
-
return instance;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
function __wbg_get_imports() {
|
|
288
|
-
const imports = {};
|
|
289
|
-
imports.wbg = {};
|
|
290
|
-
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
291
|
-
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
292
|
-
return addHeapObject(ret);
|
|
293
|
-
};
|
|
294
|
-
imports.wbg.__wbindgen_boolean_get = function(arg0) {
|
|
295
|
-
const v = getObject(arg0);
|
|
296
|
-
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
297
|
-
return ret;
|
|
298
|
-
};
|
|
299
|
-
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
300
|
-
takeObject(arg0);
|
|
301
|
-
};
|
|
302
|
-
imports.wbg.__wbg_debug_7e9ed5702b51be77 = function(arg0, arg1) {
|
|
303
|
-
let deferred0_0;
|
|
304
|
-
let deferred0_1;
|
|
305
|
-
try {
|
|
306
|
-
deferred0_0 = arg0;
|
|
307
|
-
deferred0_1 = arg1;
|
|
308
|
-
default1.debug(getStringFromWasm0(arg0, arg1));
|
|
309
|
-
} finally {
|
|
310
|
-
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
311
|
-
}
|
|
312
|
-
};
|
|
313
|
-
imports.wbg.__wbg_log_fc3cba5e8688f22a = function(arg0, arg1) {
|
|
314
|
-
let deferred0_0;
|
|
315
|
-
let deferred0_1;
|
|
316
|
-
try {
|
|
317
|
-
deferred0_0 = arg0;
|
|
318
|
-
deferred0_1 = arg1;
|
|
319
|
-
default1.log(getStringFromWasm0(arg0, arg1));
|
|
320
|
-
} finally {
|
|
321
|
-
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
322
|
-
}
|
|
323
|
-
};
|
|
324
|
-
imports.wbg.__wbg_warn_dcd6c1e84a04cb1d = function(arg0, arg1) {
|
|
325
|
-
let deferred0_0;
|
|
326
|
-
let deferred0_1;
|
|
327
|
-
try {
|
|
328
|
-
deferred0_0 = arg0;
|
|
329
|
-
deferred0_1 = arg1;
|
|
330
|
-
default1.warn(getStringFromWasm0(arg0, arg1));
|
|
331
|
-
} finally {
|
|
332
|
-
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
333
|
-
}
|
|
334
|
-
};
|
|
335
|
-
imports.wbg.__wbg_error_247913e0efe0890e = function(arg0, arg1) {
|
|
336
|
-
let deferred0_0;
|
|
337
|
-
let deferred0_1;
|
|
338
|
-
try {
|
|
339
|
-
deferred0_0 = arg0;
|
|
340
|
-
deferred0_1 = arg1;
|
|
341
|
-
default1.error(getStringFromWasm0(arg0, arg1));
|
|
342
|
-
} finally {
|
|
343
|
-
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
344
|
-
}
|
|
345
|
-
};
|
|
346
|
-
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
347
|
-
const val = getObject(arg0);
|
|
348
|
-
const ret = typeof(val) === 'object' && val !== null;
|
|
349
|
-
return ret;
|
|
350
|
-
};
|
|
351
|
-
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
352
|
-
const ret = getObject(arg0) === undefined;
|
|
353
|
-
return ret;
|
|
354
|
-
};
|
|
355
|
-
imports.wbg.__wbindgen_in = function(arg0, arg1) {
|
|
356
|
-
const ret = getObject(arg0) in getObject(arg1);
|
|
357
|
-
return ret;
|
|
358
|
-
};
|
|
359
|
-
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
360
|
-
const ret = getObject(arg0);
|
|
361
|
-
return addHeapObject(ret);
|
|
362
|
-
};
|
|
363
|
-
imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
|
|
364
|
-
const ret = getObject(arg0) == getObject(arg1);
|
|
365
|
-
return ret;
|
|
366
|
-
};
|
|
367
|
-
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
368
|
-
const obj = getObject(arg1);
|
|
369
|
-
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
370
|
-
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
371
|
-
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
372
|
-
};
|
|
373
|
-
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
374
|
-
const obj = getObject(arg1);
|
|
375
|
-
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
376
|
-
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
377
|
-
var len1 = WASM_VECTOR_LEN;
|
|
378
|
-
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
379
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
380
|
-
};
|
|
381
|
-
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
382
|
-
const ret = arg0;
|
|
383
|
-
return addHeapObject(ret);
|
|
384
|
-
};
|
|
385
|
-
imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
|
|
386
|
-
const ret = BigInt.asUintN(64, arg0);
|
|
387
|
-
return addHeapObject(ret);
|
|
388
|
-
};
|
|
389
|
-
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
390
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
391
|
-
return addHeapObject(ret);
|
|
392
|
-
};
|
|
393
|
-
imports.wbg.__wbg_getwithrefkey_4a92a5eca60879b9 = function(arg0, arg1) {
|
|
394
|
-
const ret = getObject(arg0)[getObject(arg1)];
|
|
395
|
-
return addHeapObject(ret);
|
|
396
|
-
};
|
|
397
|
-
imports.wbg.__wbg_set_9182712abebf82ef = function(arg0, arg1, arg2) {
|
|
398
|
-
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
399
|
-
};
|
|
400
|
-
imports.wbg.__wbg_new_b51585de1b234aff = function() {
|
|
401
|
-
const ret = new Object();
|
|
402
|
-
return addHeapObject(ret);
|
|
403
|
-
};
|
|
404
|
-
imports.wbg.__wbg_instanceof_ArrayBuffer_39ac22089b74fddb = function(arg0) {
|
|
405
|
-
let result;
|
|
406
|
-
try {
|
|
407
|
-
result = getObject(arg0) instanceof ArrayBuffer;
|
|
408
|
-
} catch (_) {
|
|
409
|
-
result = false;
|
|
410
|
-
}
|
|
411
|
-
const ret = result;
|
|
412
|
-
return ret;
|
|
413
|
-
};
|
|
414
|
-
imports.wbg.__wbg_buffer_085ec1f694018c4f = function(arg0) {
|
|
415
|
-
const ret = getObject(arg0).buffer;
|
|
416
|
-
return addHeapObject(ret);
|
|
417
|
-
};
|
|
418
|
-
imports.wbg.__wbg_new_8125e318e6245eed = function(arg0) {
|
|
419
|
-
const ret = new Uint8Array(getObject(arg0));
|
|
420
|
-
return addHeapObject(ret);
|
|
421
|
-
};
|
|
422
|
-
imports.wbg.__wbg_set_5cf90238115182c3 = function(arg0, arg1, arg2) {
|
|
423
|
-
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
424
|
-
};
|
|
425
|
-
imports.wbg.__wbg_length_72e2208bbc0efc61 = function(arg0) {
|
|
426
|
-
const ret = getObject(arg0).length;
|
|
427
|
-
return ret;
|
|
428
|
-
};
|
|
429
|
-
imports.wbg.__wbg_instanceof_Uint8Array_d8d9cb2b8e8ac1d4 = function(arg0) {
|
|
430
|
-
let result;
|
|
431
|
-
try {
|
|
432
|
-
result = getObject(arg0) instanceof Uint8Array;
|
|
433
|
-
} catch (_) {
|
|
434
|
-
result = false;
|
|
435
|
-
}
|
|
436
|
-
const ret = result;
|
|
437
|
-
return ret;
|
|
438
|
-
};
|
|
439
|
-
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
440
|
-
const ret = debugString(getObject(arg1));
|
|
441
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
442
|
-
const len1 = WASM_VECTOR_LEN;
|
|
443
|
-
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
444
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
445
|
-
};
|
|
446
|
-
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
447
|
-
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
448
|
-
};
|
|
449
|
-
imports.wbg.__wbindgen_memory = function() {
|
|
450
|
-
const ret = wasm.memory;
|
|
451
|
-
return addHeapObject(ret);
|
|
452
|
-
};
|
|
453
|
-
|
|
454
|
-
return imports;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
function __wbg_init_memory(imports, maybe_memory) {
|
|
458
|
-
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
function __wbg_finalize_init(instance, module) {
|
|
462
|
-
wasm = instance.exports;
|
|
463
|
-
__wbg_init.__wbindgen_wasm_module = module;
|
|
464
|
-
cachedFloat64Memory0 = null;
|
|
465
|
-
cachedInt32Memory0 = null;
|
|
466
|
-
cachedUint8Memory0 = null;
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
return wasm;
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
function initSync(module) {
|
|
473
|
-
if (wasm !== undefined) return wasm;
|
|
474
|
-
|
|
475
|
-
const imports = __wbg_get_imports();
|
|
476
|
-
|
|
477
|
-
__wbg_init_memory(imports);
|
|
478
|
-
|
|
479
|
-
if (!(module instanceof WebAssembly.Module)) {
|
|
480
|
-
module = new WebAssembly.Module(module);
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
const instance = new WebAssembly.Instance(module, imports);
|
|
484
|
-
|
|
485
|
-
return __wbg_finalize_init(instance, module);
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
async function __wbg_init(input) {
|
|
489
|
-
if (wasm !== undefined) return wasm;
|
|
490
|
-
|
|
491
|
-
if (typeof input === 'undefined') {
|
|
492
|
-
input = new URL('arcjet_analyze_js_req_bg.wasm', import.meta.url);
|
|
493
|
-
}
|
|
494
|
-
const imports = __wbg_get_imports();
|
|
495
|
-
|
|
496
|
-
if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
|
|
497
|
-
input = fetch(input);
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
__wbg_init_memory(imports);
|
|
501
|
-
|
|
502
|
-
const { instance, module } = await __wbg_load(await input, imports);
|
|
503
|
-
|
|
504
|
-
return __wbg_finalize_init(instance, module);
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
export { initSync }
|
|
508
|
-
export default __wbg_init;
|
|
Binary file
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/* tslint:disable */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
export const memory: WebAssembly.Memory;
|
|
4
|
-
export function detect_bot(a: number, b: number, c: number, d: number, e: number, f: number): number;
|
|
5
|
-
export function generate_fingerprint(a: number, b: number, c: number): void;
|
|
6
|
-
export function is_valid_email(a: number, b: number, c: number, d: number): void;
|
|
7
|
-
export function __wbindgen_malloc(a: number, b: number): number;
|
|
8
|
-
export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number;
|
|
9
|
-
export function __wbindgen_free(a: number, b: number, c: number): void;
|
|
10
|
-
export function __wbindgen_add_to_stack_pointer(a: number): number;
|