@astral-sh/ruff-wasm-web 0.12.12 → 0.13.0

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/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "Charlie Marsh <charlie.r.marsh@gmail.com>"
6
6
  ],
7
7
  "description": "WebAssembly bindings for Ruff",
8
- "version": "0.12.12",
8
+ "version": "0.13.0",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
package/ruff_wasm.js CHANGED
@@ -1,7 +1,5 @@
1
1
  let wasm;
2
2
 
3
- let WASM_VECTOR_LEN = 0;
4
-
5
3
  let cachedUint8ArrayMemory0 = null;
6
4
 
7
5
  function getUint8ArrayMemory0() {
@@ -11,6 +9,29 @@ function getUint8ArrayMemory0() {
11
9
  return cachedUint8ArrayMemory0;
12
10
  }
13
11
 
12
+ let cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
13
+
14
+ if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
15
+
16
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
17
+ let numBytesDecoded = 0;
18
+ function decodeText(ptr, len) {
19
+ numBytesDecoded += len;
20
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
21
+ cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
22
+ cachedTextDecoder.decode();
23
+ numBytesDecoded = len;
24
+ }
25
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
26
+ }
27
+
28
+ function getStringFromWasm0(ptr, len) {
29
+ ptr = ptr >>> 0;
30
+ return decodeText(ptr, len);
31
+ }
32
+
33
+ let WASM_VECTOR_LEN = 0;
34
+
14
35
  const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
15
36
 
16
37
  const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
@@ -89,15 +110,6 @@ function handleError(f, args) {
89
110
  }
90
111
  }
91
112
 
92
- const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
93
-
94
- if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
95
-
96
- function getStringFromWasm0(ptr, len) {
97
- ptr = ptr >>> 0;
98
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
99
- }
100
-
101
113
  function isLikeNone(x) {
102
114
  return x === undefined || x === null;
103
115
  }
@@ -367,6 +379,8 @@ export class Workspace {
367
379
  }
368
380
  }
369
381
 
382
+ const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
383
+
370
384
  async function __wbg_load(module, imports) {
371
385
  if (typeof Response === 'function' && module instanceof Response) {
372
386
  if (typeof WebAssembly.instantiateStreaming === 'function') {
@@ -374,7 +388,9 @@ async function __wbg_load(module, imports) {
374
388
  return await WebAssembly.instantiateStreaming(module, imports);
375
389
 
376
390
  } catch (e) {
377
- if (module.headers.get('Content-Type') != 'application/wasm') {
391
+ const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
392
+
393
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
378
394
  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);
379
395
 
380
396
  } else {
@@ -401,6 +417,10 @@ async function __wbg_load(module, imports) {
401
417
  function __wbg_get_imports() {
402
418
  const imports = {};
403
419
  imports.wbg = {};
420
+ imports.wbg.__wbg_Error_0497d5bdba9362e5 = function(arg0, arg1) {
421
+ const ret = Error(getStringFromWasm0(arg0, arg1));
422
+ return ret;
423
+ };
404
424
  imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
405
425
  const ret = String(arg1);
406
426
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -408,30 +428,30 @@ function __wbg_get_imports() {
408
428
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
409
429
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
410
430
  };
411
- imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
431
+ imports.wbg.__wbg_buffer_a1a27a0dfa70165d = function(arg0) {
412
432
  const ret = arg0.buffer;
413
433
  return ret;
414
434
  };
415
- imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
435
+ imports.wbg.__wbg_call_fbe8be8bf6436ce5 = function() { return handleError(function (arg0, arg1) {
416
436
  const ret = arg0.call(arg1);
417
437
  return ret;
418
438
  }, arguments) };
419
- imports.wbg.__wbg_codePointAt_78181f32881e5b59 = function(arg0, arg1) {
439
+ imports.wbg.__wbg_codePointAt_d9b87d53dffc810a = function(arg0, arg1) {
420
440
  const ret = arg0.codePointAt(arg1 >>> 0);
421
441
  return ret;
422
442
  };
423
- imports.wbg.__wbg_debug_3cb59063b29f58c1 = function(arg0) {
443
+ imports.wbg.__wbg_debug_58d16ea352cfbca1 = function(arg0) {
424
444
  console.debug(arg0);
425
445
  };
426
- imports.wbg.__wbg_done_769e5ede4b31c67b = function(arg0) {
446
+ imports.wbg.__wbg_done_4d01f352bade43b7 = function(arg0) {
427
447
  const ret = arg0.done;
428
448
  return ret;
429
449
  };
430
- imports.wbg.__wbg_entries_3265d4158b33e5dc = function(arg0) {
450
+ imports.wbg.__wbg_entries_41651c850143b957 = function(arg0) {
431
451
  const ret = Object.entries(arg0);
432
452
  return ret;
433
453
  };
434
- imports.wbg.__wbg_error_524f506f44df1645 = function(arg0) {
454
+ imports.wbg.__wbg_error_51ecdd39ec054205 = function(arg0) {
435
455
  console.error(arg0);
436
456
  };
437
457
  imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
@@ -445,15 +465,15 @@ function __wbg_get_imports() {
445
465
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
446
466
  }
447
467
  };
448
- imports.wbg.__wbg_fromCodePoint_f37c25c172f2e8b5 = function() { return handleError(function (arg0) {
468
+ imports.wbg.__wbg_fromCodePoint_429ae2379fd10205 = function() { return handleError(function (arg0) {
449
469
  const ret = String.fromCodePoint(arg0 >>> 0);
450
470
  return ret;
451
471
  }, arguments) };
452
- imports.wbg.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
472
+ imports.wbg.__wbg_get_92470be87867c2e5 = function() { return handleError(function (arg0, arg1) {
453
473
  const ret = Reflect.get(arg0, arg1);
454
474
  return ret;
455
475
  }, arguments) };
456
- imports.wbg.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
476
+ imports.wbg.__wbg_get_a131a44bd1eb6979 = function(arg0, arg1) {
457
477
  const ret = arg0[arg1 >>> 0];
458
478
  return ret;
459
479
  };
@@ -461,10 +481,10 @@ function __wbg_get_imports() {
461
481
  const ret = arg0[arg1];
462
482
  return ret;
463
483
  };
464
- imports.wbg.__wbg_info_3daf2e093e091b66 = function(arg0) {
484
+ imports.wbg.__wbg_info_e56933705c348038 = function(arg0) {
465
485
  console.info(arg0);
466
486
  };
467
- imports.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
487
+ imports.wbg.__wbg_instanceof_ArrayBuffer_a8b6f580b363f2bc = function(arg0) {
468
488
  let result;
469
489
  try {
470
490
  result = arg0 instanceof ArrayBuffer;
@@ -474,7 +494,7 @@ function __wbg_get_imports() {
474
494
  const ret = result;
475
495
  return ret;
476
496
  };
477
- imports.wbg.__wbg_instanceof_Map_f3469ce2244d2430 = function(arg0) {
497
+ imports.wbg.__wbg_instanceof_Map_80cc65041c96417a = function(arg0) {
478
498
  let result;
479
499
  try {
480
500
  result = arg0 instanceof Map;
@@ -484,7 +504,7 @@ function __wbg_get_imports() {
484
504
  const ret = result;
485
505
  return ret;
486
506
  };
487
- imports.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
507
+ imports.wbg.__wbg_instanceof_Uint8Array_ca460677bc155827 = function(arg0) {
488
508
  let result;
489
509
  try {
490
510
  result = arg0 instanceof Uint8Array;
@@ -494,42 +514,42 @@ function __wbg_get_imports() {
494
514
  const ret = result;
495
515
  return ret;
496
516
  };
497
- imports.wbg.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
517
+ imports.wbg.__wbg_isArray_5f090bed72bd4f89 = function(arg0) {
498
518
  const ret = Array.isArray(arg0);
499
519
  return ret;
500
520
  };
501
- imports.wbg.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
521
+ imports.wbg.__wbg_isSafeInteger_90d7c4674047d684 = function(arg0) {
502
522
  const ret = Number.isSafeInteger(arg0);
503
523
  return ret;
504
524
  };
505
- imports.wbg.__wbg_iterator_9a24c88df860dc65 = function() {
525
+ imports.wbg.__wbg_iterator_4068add5b2aef7a6 = function() {
506
526
  const ret = Symbol.iterator;
507
527
  return ret;
508
528
  };
509
- imports.wbg.__wbg_length_a446193dc22c12f8 = function(arg0) {
529
+ imports.wbg.__wbg_length_0ca5b4c83d5d9721 = function(arg0) {
510
530
  const ret = arg0.length;
511
531
  return ret;
512
532
  };
513
- imports.wbg.__wbg_length_d56737991078581b = function(arg0) {
533
+ imports.wbg.__wbg_length_ab6d22b5ead75c72 = function(arg0) {
514
534
  const ret = arg0.length;
515
535
  return ret;
516
536
  };
517
- imports.wbg.__wbg_length_e2d2a49132c1b256 = function(arg0) {
537
+ imports.wbg.__wbg_length_f00ec12454a5d9fd = function(arg0) {
518
538
  const ret = arg0.length;
519
539
  return ret;
520
540
  };
521
- imports.wbg.__wbg_log_c222819a41e063d3 = function(arg0) {
541
+ imports.wbg.__wbg_log_ea240990d83e374e = function(arg0) {
522
542
  console.log(arg0);
523
543
  };
524
- imports.wbg.__wbg_new_405e22f390576ce2 = function() {
544
+ imports.wbg.__wbg_new_07b483f72211fd66 = function() {
525
545
  const ret = new Object();
526
546
  return ret;
527
547
  };
528
- imports.wbg.__wbg_new_5e0be73521bc8c17 = function() {
529
- const ret = new Map();
548
+ imports.wbg.__wbg_new_476169e6d59f23ae = function(arg0, arg1) {
549
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
530
550
  return ret;
531
551
  };
532
- imports.wbg.__wbg_new_78feb108b6472713 = function() {
552
+ imports.wbg.__wbg_new_58353953ad2097cc = function() {
533
553
  const ret = new Array();
534
554
  return ret;
535
555
  };
@@ -537,35 +557,35 @@ function __wbg_get_imports() {
537
557
  const ret = new Error();
538
558
  return ret;
539
559
  };
540
- imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) {
541
- const ret = new Uint8Array(arg0);
560
+ imports.wbg.__wbg_new_a979b4b45bd55c7f = function() {
561
+ const ret = new Map();
542
562
  return ret;
543
563
  };
544
- imports.wbg.__wbg_new_c68d7209be747379 = function(arg0, arg1) {
545
- const ret = new Error(getStringFromWasm0(arg0, arg1));
564
+ imports.wbg.__wbg_new_e52b3efaaa774f96 = function(arg0) {
565
+ const ret = new Uint8Array(arg0);
546
566
  return ret;
547
567
  };
548
- imports.wbg.__wbg_next_25feadfc0913fea9 = function(arg0) {
568
+ imports.wbg.__wbg_next_8bb824d217961b5d = function(arg0) {
549
569
  const ret = arg0.next;
550
570
  return ret;
551
571
  };
552
- imports.wbg.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
572
+ imports.wbg.__wbg_next_e2da48d8fff7439a = function() { return handleError(function (arg0) {
553
573
  const ret = arg0.next();
554
574
  return ret;
555
575
  }, arguments) };
556
- imports.wbg.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
557
- arg0[arg1 >>> 0] = arg2;
558
- };
559
576
  imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
560
577
  arg0[arg1] = arg2;
561
578
  };
562
- imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
563
- arg0.set(arg1, arg2 >>> 0);
579
+ imports.wbg.__wbg_set_7422acbe992d64ab = function(arg0, arg1, arg2) {
580
+ arg0[arg1 >>> 0] = arg2;
564
581
  };
565
- imports.wbg.__wbg_set_8fc6bf8a5b1071d1 = function(arg0, arg1, arg2) {
582
+ imports.wbg.__wbg_set_d6bdfd275fb8a4ce = function(arg0, arg1, arg2) {
566
583
  const ret = arg0.set(arg1, arg2);
567
584
  return ret;
568
585
  };
586
+ imports.wbg.__wbg_set_fe4e79d1ed3b0e9b = function(arg0, arg1, arg2) {
587
+ arg0.set(arg1, arg2 >>> 0);
588
+ };
569
589
  imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
570
590
  const ret = arg1.stack;
571
591
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -573,11 +593,11 @@ function __wbg_get_imports() {
573
593
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
574
594
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
575
595
  };
576
- imports.wbg.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
596
+ imports.wbg.__wbg_value_17b896954e14f896 = function(arg0) {
577
597
  const ret = arg0.value;
578
598
  return ret;
579
599
  };
580
- imports.wbg.__wbg_warn_4ca3906c248c47c4 = function(arg0) {
600
+ imports.wbg.__wbg_warn_d89f6637da554c8d = function(arg0) {
581
601
  console.warn(arg0);
582
602
  };
583
603
  imports.wbg.__wbindgen_as_number = function(arg0) {
@@ -610,10 +630,6 @@ function __wbg_get_imports() {
610
630
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
611
631
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
612
632
  };
613
- imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
614
- const ret = new Error(getStringFromWasm0(arg0, arg1));
615
- return ret;
616
- };
617
633
  imports.wbg.__wbindgen_in = function(arg0, arg1) {
618
634
  const ret = arg0 in arg1;
619
635
  return ret;
package/ruff_wasm_bg.wasm CHANGED
Binary file