@arcjet/analyze 1.0.0-alpha.6 → 1.0.0-alpha.8

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.
@@ -14,7 +14,7 @@ export function detect_bot(headers: string, patterns_add: string, patterns_remov
14
14
  export function generate_fingerprint(ip: string): string;
15
15
  /**
16
16
  * @param {string} candidate
17
- * @param {EmailValidationConfig | undefined} options
17
+ * @param {EmailValidationConfig | undefined} [options]
18
18
  * @returns {boolean}
19
19
  */
20
20
  export function is_valid_email(candidate: string, options?: EmailValidationConfig): boolean;
@@ -46,7 +46,6 @@ export interface InitOutput {
46
46
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
47
47
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
48
48
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
49
- readonly __wbindgen_exn_store: (a: number) => void;
50
49
  }
51
50
 
52
51
  export type SyncInitInput = BufferSource | WebAssembly.Module;
@@ -2,26 +2,6 @@ import { default as default1 } from '@arcjet/logger';
2
2
 
3
3
  let wasm;
4
4
 
5
- const heap = new Array(128).fill(undefined);
6
-
7
- heap.push(undefined, null, true, false);
8
-
9
- function getObject(idx) { return heap[idx]; }
10
-
11
- let heap_next = heap.length;
12
-
13
- function dropObject(idx) {
14
- if (idx < 132) return;
15
- heap[idx] = heap_next;
16
- heap_next = idx;
17
- }
18
-
19
- function takeObject(idx) {
20
- const ret = getObject(idx);
21
- dropObject(idx);
22
- return ret;
23
- }
24
-
25
5
  const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
26
6
 
27
7
  if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
@@ -40,6 +20,12 @@ function getStringFromWasm0(ptr, len) {
40
20
  return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
41
21
  }
42
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
+
43
29
  function addHeapObject(obj) {
44
30
  if (heap_next === heap.length) heap.push(heap.length + 1);
45
31
  const idx = heap_next;
@@ -49,6 +35,20 @@ function addHeapObject(obj) {
49
35
  return idx;
50
36
  }
51
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
52
  function isLikeNone(x) {
53
53
  return x === undefined || x === null;
54
54
  }
@@ -232,7 +232,7 @@ export function generate_fingerprint(ip) {
232
232
 
233
233
  /**
234
234
  * @param {string} candidate
235
- * @param {EmailValidationConfig | undefined} options
235
+ * @param {EmailValidationConfig | undefined} [options]
236
236
  * @returns {boolean}
237
237
  */
238
238
  export function is_valid_email(candidate, options) {
@@ -253,14 +253,6 @@ export function is_valid_email(candidate, options) {
253
253
  }
254
254
  }
255
255
 
256
- function handleError(f, args) {
257
- try {
258
- return f.apply(this, args);
259
- } catch (e) {
260
- wasm.__wbindgen_exn_store(addHeapObject(e));
261
- }
262
- }
263
-
264
256
  async function __wbg_load(module, imports) {
265
257
  if (typeof Response === 'function' && module instanceof Response) {
266
258
  if (typeof WebAssembly.instantiateStreaming === 'function') {
@@ -295,6 +287,10 @@ async function __wbg_load(module, imports) {
295
287
  function __wbg_get_imports() {
296
288
  const imports = {};
297
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
+ };
298
294
  imports.wbg.__wbindgen_boolean_get = function(arg0) {
299
295
  const v = getObject(arg0);
300
296
  const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
@@ -303,19 +299,6 @@ function __wbg_get_imports() {
303
299
  imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
304
300
  takeObject(arg0);
305
301
  };
306
- imports.wbg.__wbindgen_is_object = function(arg0) {
307
- const val = getObject(arg0);
308
- const ret = typeof(val) === 'object' && val !== null;
309
- return ret;
310
- };
311
- imports.wbg.__wbindgen_is_undefined = function(arg0) {
312
- const ret = getObject(arg0) === undefined;
313
- return ret;
314
- };
315
- imports.wbg.__wbindgen_in = function(arg0, arg1) {
316
- const ret = getObject(arg0) in getObject(arg1);
317
- return ret;
318
- };
319
302
  imports.wbg.__wbg_debug_7e9ed5702b51be77 = function(arg0, arg1) {
320
303
  let deferred0_0;
321
304
  let deferred0_1;
@@ -360,9 +343,18 @@ function __wbg_get_imports() {
360
343
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
361
344
  }
362
345
  };
363
- imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
364
- const ret = new Error(getStringFromWasm0(arg0, arg1));
365
- return addHeapObject(ret);
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;
366
358
  };
367
359
  imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
368
360
  const ret = getObject(arg0);
@@ -386,19 +378,34 @@ function __wbg_get_imports() {
386
378
  getInt32Memory0()[arg0 / 4 + 1] = len1;
387
379
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
388
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
389
  imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
390
390
  const ret = getStringFromWasm0(arg0, arg1);
391
391
  return addHeapObject(ret);
392
392
  };
393
- imports.wbg.__wbg_getwithrefkey_5e6d9547403deab8 = function(arg0, arg1) {
393
+ imports.wbg.__wbg_getwithrefkey_4a92a5eca60879b9 = function(arg0, arg1) {
394
394
  const ret = getObject(arg0)[getObject(arg1)];
395
395
  return addHeapObject(ret);
396
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
+ };
397
404
  imports.wbg.__wbg_instanceof_ArrayBuffer_39ac22089b74fddb = function(arg0) {
398
405
  let result;
399
406
  try {
400
407
  result = getObject(arg0) instanceof ArrayBuffer;
401
- } catch {
408
+ } catch (_) {
402
409
  result = false;
403
410
  }
404
411
  const ret = result;
@@ -423,16 +430,12 @@ function __wbg_get_imports() {
423
430
  let result;
424
431
  try {
425
432
  result = getObject(arg0) instanceof Uint8Array;
426
- } catch {
433
+ } catch (_) {
427
434
  result = false;
428
435
  }
429
436
  const ret = result;
430
437
  return ret;
431
438
  };
432
- imports.wbg.__wbg_parse_670c19d4e984792e = function() { return handleError(function (arg0, arg1) {
433
- const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
434
- return addHeapObject(ret);
435
- }, arguments) };
436
439
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
437
440
  const ret = debugString(getObject(arg1));
438
441
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
Binary file
@@ -8,4 +8,3 @@ export function __wbindgen_malloc(a: number, b: number): number;
8
8
  export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number;
9
9
  export function __wbindgen_free(a: number, b: number, c: number): void;
10
10
  export function __wbindgen_add_to_stack_pointer(a: number): number;
11
- export function __wbindgen_exn_store(a: number): void;