@astral-sh/ruff-wasm-bundler 0.15.17 → 0.15.18

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.15.17",
8
+ "version": "0.15.18",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
package/ruff_wasm.d.ts CHANGED
@@ -1,29 +1,11 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- /**
4
- * Initializes the logger with the given log level.
5
- *
6
- * ## Panics
7
- * If this function is called more than once.
8
- */
9
- export function initLogging(level: LogLevel): void;
10
- export function run(): void;
11
- export enum LogLevel {
12
- Trace = 0,
13
- Debug = 1,
14
- Info = 2,
15
- Warn = 3,
16
- Error = 4,
17
- }
18
- export enum PositionEncoding {
19
- Utf8 = 0,
20
- Utf16 = 1,
21
- Utf32 = 2,
22
- }
23
3
 
24
4
  export interface Diagnostic {
25
5
  code: string | null;
26
6
  message: string;
7
+ tags: DiagnosticTag[];
8
+ annotations: DiagnosticAnnotation[];
27
9
  subDiagnostics: SubDiagnostic[];
28
10
  start_location: {
29
11
  row: number;
@@ -49,10 +31,18 @@ export interface Diagnostic {
49
31
  } | null;
50
32
  }
51
33
 
34
+ export type DiagnosticTag = "unnecessary" | "deprecated";
35
+
36
+ export interface DiagnosticAnnotation {
37
+ primary: boolean;
38
+ message: string | null;
39
+ location: DiagnosticLocation | null;
40
+ }
41
+
52
42
  export interface SubDiagnostic {
53
43
  severity: SubDiagnosticSeverity;
54
44
  message: string;
55
- location: SubDiagnosticLocation | null;
45
+ location: DiagnosticLocation | null;
56
46
  }
57
47
 
58
48
  export enum SubDiagnosticSeverity {
@@ -63,7 +53,7 @@ export enum SubDiagnosticSeverity {
63
53
  Fatal = "fatal",
64
54
  }
65
55
 
66
- export interface SubDiagnosticLocation {
56
+ export interface DiagnosticLocation {
67
57
  path: string;
68
58
  start_location: {
69
59
  row: number;
@@ -76,19 +66,44 @@ export interface SubDiagnosticLocation {
76
66
  }
77
67
 
78
68
 
69
+
70
+ export enum LogLevel {
71
+ Trace = 0,
72
+ Debug = 1,
73
+ Info = 2,
74
+ Warn = 3,
75
+ Error = 4,
76
+ }
77
+
78
+ export enum PositionEncoding {
79
+ Utf8 = 0,
80
+ Utf16 = 1,
81
+ Utf32 = 2,
82
+ }
83
+
79
84
  export class Workspace {
80
- free(): void;
81
- [Symbol.dispose](): void;
82
- static defaultSettings(): any;
83
- constructor(options: any, position_encoding: PositionEncoding);
84
- check(contents: string): any;
85
- /**
86
- * Parses the content and returns its AST
87
- */
88
- parse(contents: string): string;
89
- format(contents: string): string;
90
- tokens(contents: string): string;
91
- static version(): string;
92
- comments(contents: string): string;
93
- format_ir(contents: string): string;
85
+ free(): void;
86
+ [Symbol.dispose](): void;
87
+ check(contents: string): any;
88
+ comments(contents: string): string;
89
+ static defaultSettings(): any;
90
+ format(contents: string): string;
91
+ format_ir(contents: string): string;
92
+ constructor(options: any, position_encoding: PositionEncoding);
93
+ /**
94
+ * Parses the content and returns its AST
95
+ */
96
+ parse(contents: string): string;
97
+ tokens(contents: string): string;
98
+ static version(): string;
94
99
  }
100
+
101
+ /**
102
+ * Initializes the logger with the given log level.
103
+ *
104
+ * ## Panics
105
+ * If this function is called more than once.
106
+ */
107
+ export function initLogging(level: LogLevel): void;
108
+
109
+ export function run(): void;
package/ruff_wasm.js CHANGED
@@ -1,5 +1,9 @@
1
+ /* @ts-self-types="./ruff_wasm.d.ts" */
1
2
  import * as wasm from "./ruff_wasm_bg.wasm";
2
- export * from "./ruff_wasm_bg.js";
3
3
  import { __wbg_set_wasm } from "./ruff_wasm_bg.js";
4
+
4
5
  __wbg_set_wasm(wasm);
5
6
  wasm.__wbindgen_start();
7
+ export {
8
+ LogLevel, PositionEncoding, Workspace, initLogging, run
9
+ } from "./ruff_wasm_bg.js";
package/ruff_wasm_bg.js CHANGED
@@ -1,210 +1,3 @@
1
- let wasm;
2
- export function __wbg_set_wasm(val) {
3
- wasm = val;
4
- }
5
-
6
-
7
- let cachedUint8ArrayMemory0 = null;
8
-
9
- function getUint8ArrayMemory0() {
10
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
11
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
12
- }
13
- return cachedUint8ArrayMemory0;
14
- }
15
-
16
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
17
-
18
- cachedTextDecoder.decode();
19
-
20
- const MAX_SAFARI_DECODE_BYTES = 2146435072;
21
- let numBytesDecoded = 0;
22
- function decodeText(ptr, len) {
23
- numBytesDecoded += len;
24
- if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
25
- cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
26
- cachedTextDecoder.decode();
27
- numBytesDecoded = len;
28
- }
29
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
30
- }
31
-
32
- function getStringFromWasm0(ptr, len) {
33
- ptr = ptr >>> 0;
34
- return decodeText(ptr, len);
35
- }
36
-
37
- let WASM_VECTOR_LEN = 0;
38
-
39
- const cachedTextEncoder = new TextEncoder();
40
-
41
- if (!('encodeInto' in cachedTextEncoder)) {
42
- cachedTextEncoder.encodeInto = function (arg, view) {
43
- const buf = cachedTextEncoder.encode(arg);
44
- view.set(buf);
45
- return {
46
- read: arg.length,
47
- written: buf.length
48
- };
49
- }
50
- }
51
-
52
- function passStringToWasm0(arg, malloc, realloc) {
53
-
54
- if (realloc === undefined) {
55
- const buf = cachedTextEncoder.encode(arg);
56
- const ptr = malloc(buf.length, 1) >>> 0;
57
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
58
- WASM_VECTOR_LEN = buf.length;
59
- return ptr;
60
- }
61
-
62
- let len = arg.length;
63
- let ptr = malloc(len, 1) >>> 0;
64
-
65
- const mem = getUint8ArrayMemory0();
66
-
67
- let offset = 0;
68
-
69
- for (; offset < len; offset++) {
70
- const code = arg.charCodeAt(offset);
71
- if (code > 0x7F) break;
72
- mem[ptr + offset] = code;
73
- }
74
-
75
- if (offset !== len) {
76
- if (offset !== 0) {
77
- arg = arg.slice(offset);
78
- }
79
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
80
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
81
- const ret = cachedTextEncoder.encodeInto(arg, view);
82
-
83
- offset += ret.written;
84
- ptr = realloc(ptr, len, offset, 1) >>> 0;
85
- }
86
-
87
- WASM_VECTOR_LEN = offset;
88
- return ptr;
89
- }
90
-
91
- let cachedDataViewMemory0 = null;
92
-
93
- function getDataViewMemory0() {
94
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
95
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
96
- }
97
- return cachedDataViewMemory0;
98
- }
99
-
100
- function isLikeNone(x) {
101
- return x === undefined || x === null;
102
- }
103
-
104
- function debugString(val) {
105
- // primitive types
106
- const type = typeof val;
107
- if (type == 'number' || type == 'boolean' || val == null) {
108
- return `${val}`;
109
- }
110
- if (type == 'string') {
111
- return `"${val}"`;
112
- }
113
- if (type == 'symbol') {
114
- const description = val.description;
115
- if (description == null) {
116
- return 'Symbol';
117
- } else {
118
- return `Symbol(${description})`;
119
- }
120
- }
121
- if (type == 'function') {
122
- const name = val.name;
123
- if (typeof name == 'string' && name.length > 0) {
124
- return `Function(${name})`;
125
- } else {
126
- return 'Function';
127
- }
128
- }
129
- // objects
130
- if (Array.isArray(val)) {
131
- const length = val.length;
132
- let debug = '[';
133
- if (length > 0) {
134
- debug += debugString(val[0]);
135
- }
136
- for(let i = 1; i < length; i++) {
137
- debug += ', ' + debugString(val[i]);
138
- }
139
- debug += ']';
140
- return debug;
141
- }
142
- // Test for built-in
143
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
144
- let className;
145
- if (builtInMatches && builtInMatches.length > 1) {
146
- className = builtInMatches[1];
147
- } else {
148
- // Failed to match the standard '[object ClassName]'
149
- return toString.call(val);
150
- }
151
- if (className == 'Object') {
152
- // we're a user defined class or Object
153
- // JSON.stringify avoids problems with cycles, and is generally much
154
- // easier than looping through ownProperties of `val`.
155
- try {
156
- return 'Object(' + JSON.stringify(val) + ')';
157
- } catch (_) {
158
- return 'Object';
159
- }
160
- }
161
- // errors
162
- if (val instanceof Error) {
163
- return `${val.name}: ${val.message}\n${val.stack}`;
164
- }
165
- // TODO we could test for more things here, like `Set`s and `Map`s.
166
- return className;
167
- }
168
-
169
- function addToExternrefTable0(obj) {
170
- const idx = wasm.__externref_table_alloc();
171
- wasm.__wbindgen_externrefs.set(idx, obj);
172
- return idx;
173
- }
174
-
175
- function handleError(f, args) {
176
- try {
177
- return f.apply(this, args);
178
- } catch (e) {
179
- const idx = addToExternrefTable0(e);
180
- wasm.__wbindgen_exn_store(idx);
181
- }
182
- }
183
-
184
- function getArrayU8FromWasm0(ptr, len) {
185
- ptr = ptr >>> 0;
186
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
187
- }
188
- /**
189
- * Initializes the logger with the given log level.
190
- *
191
- * ## Panics
192
- * If this function is called more than once.
193
- * @param {LogLevel} level
194
- */
195
- export function initLogging(level) {
196
- wasm.initLogging(level);
197
- }
198
-
199
- export function run() {
200
- wasm.run();
201
- }
202
-
203
- function takeFromExternrefTable0(idx) {
204
- const value = wasm.__wbindgen_externrefs.get(idx);
205
- wasm.__externref_table_dealloc(idx);
206
- return value;
207
- }
208
1
  /**
209
2
  * @enum {0 | 1 | 2 | 3 | 4}
210
3
  */
@@ -215,6 +8,7 @@ export const LogLevel = Object.freeze({
215
8
  Warn: 3, "3": "Warn",
216
9
  Error: 4, "4": "Error",
217
10
  });
11
+
218
12
  /**
219
13
  * @enum {0 | 1 | 2}
220
14
  */
@@ -224,46 +18,17 @@ export const PositionEncoding = Object.freeze({
224
18
  Utf32: 2, "2": "Utf32",
225
19
  });
226
20
 
227
- const WorkspaceFinalization = (typeof FinalizationRegistry === 'undefined')
228
- ? { register: () => {}, unregister: () => {} }
229
- : new FinalizationRegistry(ptr => wasm.__wbg_workspace_free(ptr >>> 0, 1));
230
-
231
21
  export class Workspace {
232
-
233
22
  __destroy_into_raw() {
234
23
  const ptr = this.__wbg_ptr;
235
24
  this.__wbg_ptr = 0;
236
25
  WorkspaceFinalization.unregister(this);
237
26
  return ptr;
238
27
  }
239
-
240
28
  free() {
241
29
  const ptr = this.__destroy_into_raw();
242
30
  wasm.__wbg_workspace_free(ptr, 0);
243
31
  }
244
- /**
245
- * @returns {any}
246
- */
247
- static defaultSettings() {
248
- const ret = wasm.workspace_defaultSettings();
249
- if (ret[2]) {
250
- throw takeFromExternrefTable0(ret[1]);
251
- }
252
- return takeFromExternrefTable0(ret[0]);
253
- }
254
- /**
255
- * @param {any} options
256
- * @param {PositionEncoding} position_encoding
257
- */
258
- constructor(options, position_encoding) {
259
- const ret = wasm.workspace_new(options, position_encoding);
260
- if (ret[2]) {
261
- throw takeFromExternrefTable0(ret[1]);
262
- }
263
- this.__wbg_ptr = ret[0] >>> 0;
264
- WorkspaceFinalization.register(this, this.__wbg_ptr, this);
265
- return this;
266
- }
267
32
  /**
268
33
  * @param {string} contents
269
34
  * @returns {any}
@@ -278,17 +43,16 @@ export class Workspace {
278
43
  return takeFromExternrefTable0(ret[0]);
279
44
  }
280
45
  /**
281
- * Parses the content and returns its AST
282
46
  * @param {string} contents
283
47
  * @returns {string}
284
48
  */
285
- parse(contents) {
49
+ comments(contents) {
286
50
  let deferred3_0;
287
51
  let deferred3_1;
288
52
  try {
289
53
  const ptr0 = passStringToWasm0(contents, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
290
54
  const len0 = WASM_VECTOR_LEN;
291
- const ret = wasm.workspace_parse(this.__wbg_ptr, ptr0, len0);
55
+ const ret = wasm.workspace_comments(this.__wbg_ptr, ptr0, len0);
292
56
  var ptr2 = ret[0];
293
57
  var len2 = ret[1];
294
58
  if (ret[3]) {
@@ -302,6 +66,16 @@ export class Workspace {
302
66
  wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
303
67
  }
304
68
  }
69
+ /**
70
+ * @returns {any}
71
+ */
72
+ static defaultSettings() {
73
+ const ret = wasm.workspace_defaultSettings();
74
+ if (ret[2]) {
75
+ throw takeFromExternrefTable0(ret[1]);
76
+ }
77
+ return takeFromExternrefTable0(ret[0]);
78
+ }
305
79
  /**
306
80
  * @param {string} contents
307
81
  * @returns {string}
@@ -330,13 +104,13 @@ export class Workspace {
330
104
  * @param {string} contents
331
105
  * @returns {string}
332
106
  */
333
- tokens(contents) {
107
+ format_ir(contents) {
334
108
  let deferred3_0;
335
109
  let deferred3_1;
336
110
  try {
337
111
  const ptr0 = passStringToWasm0(contents, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
338
112
  const len0 = WASM_VECTOR_LEN;
339
- const ret = wasm.workspace_tokens(this.__wbg_ptr, ptr0, len0);
113
+ const ret = wasm.workspace_format_ir(this.__wbg_ptr, ptr0, len0);
340
114
  var ptr2 = ret[0];
341
115
  var len2 = ret[1];
342
116
  if (ret[3]) {
@@ -351,31 +125,30 @@ export class Workspace {
351
125
  }
352
126
  }
353
127
  /**
354
- * @returns {string}
128
+ * @param {any} options
129
+ * @param {PositionEncoding} position_encoding
355
130
  */
356
- static version() {
357
- let deferred1_0;
358
- let deferred1_1;
359
- try {
360
- const ret = wasm.workspace_version();
361
- deferred1_0 = ret[0];
362
- deferred1_1 = ret[1];
363
- return getStringFromWasm0(ret[0], ret[1]);
364
- } finally {
365
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
131
+ constructor(options, position_encoding) {
132
+ const ret = wasm.workspace_new(options, position_encoding);
133
+ if (ret[2]) {
134
+ throw takeFromExternrefTable0(ret[1]);
366
135
  }
136
+ this.__wbg_ptr = ret[0];
137
+ WorkspaceFinalization.register(this, this.__wbg_ptr, this);
138
+ return this;
367
139
  }
368
140
  /**
141
+ * Parses the content and returns its AST
369
142
  * @param {string} contents
370
143
  * @returns {string}
371
144
  */
372
- comments(contents) {
145
+ parse(contents) {
373
146
  let deferred3_0;
374
147
  let deferred3_1;
375
148
  try {
376
149
  const ptr0 = passStringToWasm0(contents, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
377
150
  const len0 = WASM_VECTOR_LEN;
378
- const ret = wasm.workspace_comments(this.__wbg_ptr, ptr0, len0);
151
+ const ret = wasm.workspace_parse(this.__wbg_ptr, ptr0, len0);
379
152
  var ptr2 = ret[0];
380
153
  var len2 = ret[1];
381
154
  if (ret[3]) {
@@ -393,13 +166,13 @@ export class Workspace {
393
166
  * @param {string} contents
394
167
  * @returns {string}
395
168
  */
396
- format_ir(contents) {
169
+ tokens(contents) {
397
170
  let deferred3_0;
398
171
  let deferred3_1;
399
172
  try {
400
173
  const ptr0 = passStringToWasm0(contents, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
401
174
  const len0 = WASM_VECTOR_LEN;
402
- const ret = wasm.workspace_format_ir(this.__wbg_ptr, ptr0, len0);
175
+ const ret = wasm.workspace_tokens(this.__wbg_ptr, ptr0, len0);
403
176
  var ptr2 = ret[0];
404
177
  var len2 = ret[1];
405
178
  if (ret[3]) {
@@ -413,134 +186,144 @@ export class Workspace {
413
186
  wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
414
187
  }
415
188
  }
189
+ /**
190
+ * @returns {string}
191
+ */
192
+ static version() {
193
+ let deferred1_0;
194
+ let deferred1_1;
195
+ try {
196
+ const ret = wasm.workspace_version();
197
+ deferred1_0 = ret[0];
198
+ deferred1_1 = ret[1];
199
+ return getStringFromWasm0(ret[0], ret[1]);
200
+ } finally {
201
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
202
+ }
203
+ }
416
204
  }
417
205
  if (Symbol.dispose) Workspace.prototype[Symbol.dispose] = Workspace.prototype.free;
418
206
 
419
- export function __wbg_Error_e83987f665cf5504(arg0, arg1) {
207
+ /**
208
+ * Initializes the logger with the given log level.
209
+ *
210
+ * ## Panics
211
+ * If this function is called more than once.
212
+ * @param {LogLevel} level
213
+ */
214
+ export function initLogging(level) {
215
+ wasm.initLogging(level);
216
+ }
217
+
218
+ export function run() {
219
+ wasm.run();
220
+ }
221
+ export function __wbg_Error_9dc85fe1bc224456(arg0, arg1) {
420
222
  const ret = Error(getStringFromWasm0(arg0, arg1));
421
223
  return ret;
422
- };
423
-
424
- export function __wbg_Number_bb48ca12f395cd08(arg0) {
224
+ }
225
+ export function __wbg_Number_4779d427bae39753(arg0) {
425
226
  const ret = Number(arg0);
426
227
  return ret;
427
- };
428
-
429
- export function __wbg_String_8f0eb39a4a4c2f66(arg0, arg1) {
228
+ }
229
+ export function __wbg_String_8564e559799eccda(arg0, arg1) {
430
230
  const ret = String(arg1);
431
231
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
432
232
  const len1 = WASM_VECTOR_LEN;
433
233
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
434
234
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
435
- };
436
-
437
- export function __wbg___wbindgen_bigint_get_as_i64_f3ebc5a755000afd(arg0, arg1) {
235
+ }
236
+ export function __wbg___wbindgen_bigint_get_as_i64_8ea6736501f396b6(arg0, arg1) {
438
237
  const v = arg1;
439
238
  const ret = typeof(v) === 'bigint' ? v : undefined;
440
239
  getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
441
240
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
442
- };
443
-
444
- export function __wbg___wbindgen_boolean_get_6d5a1ee65bab5f68(arg0) {
241
+ }
242
+ export function __wbg___wbindgen_boolean_get_b131b2f36d6b2f55(arg0) {
445
243
  const v = arg0;
446
244
  const ret = typeof(v) === 'boolean' ? v : undefined;
447
245
  return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
448
- };
449
-
450
- export function __wbg___wbindgen_debug_string_df47ffb5e35e6763(arg0, arg1) {
246
+ }
247
+ export function __wbg___wbindgen_debug_string_56c147eb1a51f0c4(arg0, arg1) {
451
248
  const ret = debugString(arg1);
452
249
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
453
250
  const len1 = WASM_VECTOR_LEN;
454
251
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
455
252
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
456
- };
457
-
458
- export function __wbg___wbindgen_in_bb933bd9e1b3bc0f(arg0, arg1) {
253
+ }
254
+ export function __wbg___wbindgen_in_ce8569b2fc6f5088(arg0, arg1) {
459
255
  const ret = arg0 in arg1;
460
256
  return ret;
461
- };
462
-
463
- export function __wbg___wbindgen_is_bigint_cb320707dcd35f0b(arg0) {
257
+ }
258
+ export function __wbg___wbindgen_is_bigint_df272c65456269c2(arg0) {
464
259
  const ret = typeof(arg0) === 'bigint';
465
260
  return ret;
466
- };
467
-
468
- export function __wbg___wbindgen_is_function_ee8a6c5833c90377(arg0) {
261
+ }
262
+ export function __wbg___wbindgen_is_function_147961669f068cd4(arg0) {
469
263
  const ret = typeof(arg0) === 'function';
470
264
  return ret;
471
- };
472
-
473
- export function __wbg___wbindgen_is_object_c818261d21f283a4(arg0) {
265
+ }
266
+ export function __wbg___wbindgen_is_object_3a2c414391dbf751(arg0) {
474
267
  const val = arg0;
475
268
  const ret = typeof(val) === 'object' && val !== null;
476
269
  return ret;
477
- };
478
-
479
- export function __wbg___wbindgen_is_string_fbb76cb2940daafd(arg0) {
270
+ }
271
+ export function __wbg___wbindgen_is_string_6541b0f6ecd4e8e5(arg0) {
480
272
  const ret = typeof(arg0) === 'string';
481
273
  return ret;
482
- };
483
-
484
- export function __wbg___wbindgen_is_undefined_2d472862bd29a478(arg0) {
274
+ }
275
+ export function __wbg___wbindgen_is_undefined_4410e3c20a99fa97(arg0) {
485
276
  const ret = arg0 === undefined;
486
277
  return ret;
487
- };
488
-
489
- export function __wbg___wbindgen_jsval_eq_6b13ab83478b1c50(arg0, arg1) {
278
+ }
279
+ export function __wbg___wbindgen_jsval_eq_174c93ec61bab0c5(arg0, arg1) {
490
280
  const ret = arg0 === arg1;
491
281
  return ret;
492
- };
493
-
494
- export function __wbg___wbindgen_jsval_loose_eq_b664b38a2f582147(arg0, arg1) {
282
+ }
283
+ export function __wbg___wbindgen_jsval_loose_eq_e07e3b1f5db6da6c(arg0, arg1) {
495
284
  const ret = arg0 == arg1;
496
285
  return ret;
497
- };
498
-
499
- export function __wbg___wbindgen_number_get_a20bf9b85341449d(arg0, arg1) {
286
+ }
287
+ export function __wbg___wbindgen_number_get_588ed6b97f0d7e14(arg0, arg1) {
500
288
  const obj = arg1;
501
289
  const ret = typeof(obj) === 'number' ? obj : undefined;
502
290
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
503
291
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
504
- };
505
-
506
- export function __wbg___wbindgen_string_get_e4f06c90489ad01b(arg0, arg1) {
292
+ }
293
+ export function __wbg___wbindgen_string_get_fa2687d531ed17a5(arg0, arg1) {
507
294
  const obj = arg1;
508
295
  const ret = typeof(obj) === 'string' ? obj : undefined;
509
296
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
510
297
  var len1 = WASM_VECTOR_LEN;
511
298
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
512
299
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
513
- };
514
-
515
- export function __wbg___wbindgen_throw_b855445ff6a94295(arg0, arg1) {
300
+ }
301
+ export function __wbg___wbindgen_throw_bbadd78c1bac3a77(arg0, arg1) {
516
302
  throw new Error(getStringFromWasm0(arg0, arg1));
517
- };
518
-
519
- export function __wbg_call_e762c39fa8ea36bf() { return handleError(function (arg0, arg1) {
303
+ }
304
+ export function __wbg_call_91f00ddc43e01490() { return handleError(function (arg0, arg1) {
520
305
  const ret = arg0.call(arg1);
521
306
  return ret;
522
- }, arguments) };
523
-
524
- export function __wbg_codePointAt_01a186303396f7ad(arg0, arg1) {
307
+ }, arguments); }
308
+ export function __wbg_codePointAt_92c678dd76a87be4(arg0, arg1) {
525
309
  const ret = arg0.codePointAt(arg1 >>> 0);
526
310
  return ret;
527
- };
528
-
529
- export function __wbg_debug_f4b0c59db649db48(arg0) {
311
+ }
312
+ export function __wbg_debug_de823612d4d12f74(arg0) {
530
313
  console.debug(arg0);
531
- };
532
-
533
- export function __wbg_done_2042aa2670fb1db1(arg0) {
314
+ }
315
+ export function __wbg_done_6a8439e544ec6206(arg0) {
534
316
  const ret = arg0.done;
535
317
  return ret;
536
- };
537
-
538
- export function __wbg_entries_e171b586f8f6bdbf(arg0) {
318
+ }
319
+ export function __wbg_entries_5a6a7e7e0df09fe5(arg0) {
539
320
  const ret = Object.entries(arg0);
540
321
  return ret;
541
- };
542
-
543
- export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
322
+ }
323
+ export function __wbg_error_6651fee1c71e5da9(arg0) {
324
+ console.error(arg0);
325
+ }
326
+ export function __wbg_error_a6fa202b58aa1cd3(arg0, arg1) {
544
327
  let deferred0_0;
545
328
  let deferred0_1;
546
329
  try {
@@ -550,37 +333,31 @@ export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
550
333
  } finally {
551
334
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
552
335
  }
553
- };
554
-
555
- export function __wbg_error_a7f8fbb0523dae15(arg0) {
556
- console.error(arg0);
557
- };
558
-
559
- export function __wbg_fromCodePoint_a1c5bb992dc05846() { return handleError(function (arg0) {
336
+ }
337
+ export function __wbg_fromCodePoint_9732a81eca648320() { return handleError(function (arg0) {
560
338
  const ret = String.fromCodePoint(arg0 >>> 0);
561
339
  return ret;
562
- }, arguments) };
563
-
564
- export function __wbg_get_7bed016f185add81(arg0, arg1) {
340
+ }, arguments); }
341
+ export function __wbg_get_44e98e27bda25b5b() { return handleError(function (arg0, arg1) {
342
+ const ret = Reflect.get(arg0, arg1);
343
+ return ret;
344
+ }, arguments); }
345
+ export function __wbg_get_4b90d6d8c5deb5d5(arg0, arg1) {
565
346
  const ret = arg0[arg1 >>> 0];
566
347
  return ret;
567
- };
568
-
569
- export function __wbg_get_efcb449f58ec27c2() { return handleError(function (arg0, arg1) {
570
- const ret = Reflect.get(arg0, arg1);
348
+ }
349
+ export function __wbg_get_unchecked_46e778e3cec74b5e(arg0, arg1) {
350
+ const ret = arg0[arg1 >>> 0];
571
351
  return ret;
572
- }, arguments) };
573
-
574
- export function __wbg_get_with_ref_key_1dc361bd10053bfe(arg0, arg1) {
352
+ }
353
+ export function __wbg_get_with_ref_key_6412cf3094599694(arg0, arg1) {
575
354
  const ret = arg0[arg1];
576
355
  return ret;
577
- };
578
-
579
- export function __wbg_info_e674a11f4f50cc0c(arg0) {
356
+ }
357
+ export function __wbg_info_a2b5f8a5dae8b26c(arg0) {
580
358
  console.info(arg0);
581
- };
582
-
583
- export function __wbg_instanceof_ArrayBuffer_70beb1189ca63b38(arg0) {
359
+ }
360
+ export function __wbg_instanceof_ArrayBuffer_a581da923203f29f(arg0) {
584
361
  let result;
585
362
  try {
586
363
  result = arg0 instanceof ArrayBuffer;
@@ -589,9 +366,8 @@ export function __wbg_instanceof_ArrayBuffer_70beb1189ca63b38(arg0) {
589
366
  }
590
367
  const ret = result;
591
368
  return ret;
592
- };
593
-
594
- export function __wbg_instanceof_Map_8579b5e2ab5437c7(arg0) {
369
+ }
370
+ export function __wbg_instanceof_Map_7f94c740225003e2(arg0) {
595
371
  let result;
596
372
  try {
597
373
  result = arg0 instanceof Map;
@@ -600,9 +376,8 @@ export function __wbg_instanceof_Map_8579b5e2ab5437c7(arg0) {
600
376
  }
601
377
  const ret = result;
602
378
  return ret;
603
- };
604
-
605
- export function __wbg_instanceof_Uint8Array_20c8e73002f7af98(arg0) {
379
+ }
380
+ export function __wbg_instanceof_Uint8Array_b6fe1ac89eba107e(arg0) {
606
381
  let result;
607
382
  try {
608
383
  result = arg0 instanceof Uint8Array;
@@ -611,145 +386,113 @@ export function __wbg_instanceof_Uint8Array_20c8e73002f7af98(arg0) {
611
386
  }
612
387
  const ret = result;
613
388
  return ret;
614
- };
615
-
616
- export function __wbg_isArray_96e0af9891d0945d(arg0) {
389
+ }
390
+ export function __wbg_isArray_139f48e3c057ede8(arg0) {
617
391
  const ret = Array.isArray(arg0);
618
392
  return ret;
619
- };
620
-
621
- export function __wbg_isSafeInteger_d216eda7911dde36(arg0) {
393
+ }
394
+ export function __wbg_isSafeInteger_c22ccb4af2201fe9(arg0) {
622
395
  const ret = Number.isSafeInteger(arg0);
623
396
  return ret;
624
- };
625
-
626
- export function __wbg_iterator_e5822695327a3c39() {
397
+ }
398
+ export function __wbg_iterator_9b36cebf3be7b7cd() {
627
399
  const ret = Symbol.iterator;
628
400
  return ret;
629
- };
630
-
631
- export function __wbg_length_69bca3cb64fc8748(arg0) {
401
+ }
402
+ export function __wbg_length_68a9d5278d084f4f(arg0) {
632
403
  const ret = arg0.length;
633
404
  return ret;
634
- };
635
-
636
- export function __wbg_length_a95b69f903b746c4(arg0) {
405
+ }
406
+ export function __wbg_length_7abf942ae12c9744(arg0) {
637
407
  const ret = arg0.length;
638
408
  return ret;
639
- };
640
-
641
- export function __wbg_length_cdd215e10d9dd507(arg0) {
409
+ }
410
+ export function __wbg_length_fb04d16d7bdf6d4c(arg0) {
642
411
  const ret = arg0.length;
643
412
  return ret;
644
- };
645
-
646
- export function __wbg_log_8cec76766b8c0e33(arg0) {
413
+ }
414
+ export function __wbg_log_6614a4effdb4e983(arg0) {
647
415
  console.log(arg0);
648
- };
649
-
650
- export function __wbg_new_1acc0b6eea89d040() {
651
- const ret = new Object();
652
- return ret;
653
- };
654
-
655
- export function __wbg_new_5a79be3ab53b8aa5(arg0) {
656
- const ret = new Uint8Array(arg0);
416
+ }
417
+ export function __wbg_new_0b303268aa395a38() {
418
+ const ret = new Array();
657
419
  return ret;
658
- };
659
-
660
- export function __wbg_new_68651c719dcda04e() {
661
- const ret = new Map();
420
+ }
421
+ export function __wbg_new_20b778a4c5c691c3() {
422
+ const ret = new Object();
662
423
  return ret;
663
- };
664
-
665
- export function __wbg_new_8a6f238a6ece86ea() {
424
+ }
425
+ export function __wbg_new_227d7c05414eb861() {
666
426
  const ret = new Error();
667
427
  return ret;
668
- };
669
-
670
- export function __wbg_new_a7442b4b19c1a356(arg0, arg1) {
428
+ }
429
+ export function __wbg_new_5fae30e6b23db8df(arg0, arg1) {
671
430
  const ret = new Error(getStringFromWasm0(arg0, arg1));
672
431
  return ret;
673
- };
674
-
675
- export function __wbg_new_e17d9f43105b08be() {
676
- const ret = new Array();
432
+ }
433
+ export function __wbg_new_883c0db065f06efd() {
434
+ const ret = new Map();
677
435
  return ret;
678
- };
679
-
680
- export function __wbg_next_020810e0ae8ebcb0() { return handleError(function (arg0) {
436
+ }
437
+ export function __wbg_new_b06772b280cc6e52(arg0) {
438
+ const ret = new Uint8Array(arg0);
439
+ return ret;
440
+ }
441
+ export function __wbg_next_8cb028b6ba50743f() { return handleError(function (arg0) {
681
442
  const ret = arg0.next();
682
443
  return ret;
683
- }, arguments) };
684
-
685
- export function __wbg_next_2c826fe5dfec6b6a(arg0) {
444
+ }, arguments); }
445
+ export function __wbg_next_cfd0b146c9538df8(arg0) {
686
446
  const ret = arg0.next;
687
447
  return ret;
688
- };
689
-
690
- export function __wbg_now_793306c526e2e3b6() {
691
- const ret = Date.now();
692
- return ret;
693
- };
694
-
695
- export function __wbg_prototypesetcall_2a6620b6922694b2(arg0, arg1, arg2) {
448
+ }
449
+ export function __wbg_prototypesetcall_956c7493c68e29b4(arg0, arg1, arg2) {
696
450
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
697
- };
698
-
699
- export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
700
- arg0[arg1] = arg2;
701
- };
702
-
703
- export function __wbg_set_907fb406c34a251d(arg0, arg1, arg2) {
451
+ }
452
+ export function __wbg_set_5f806304fb633ab3(arg0, arg1, arg2) {
704
453
  const ret = arg0.set(arg1, arg2);
705
454
  return ret;
706
- };
707
-
708
- export function __wbg_set_c213c871859d6500(arg0, arg1, arg2) {
455
+ }
456
+ export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) {
457
+ arg0[arg1] = arg2;
458
+ }
459
+ export function __wbg_set_da33c120a6584674(arg0, arg1, arg2) {
709
460
  arg0[arg1 >>> 0] = arg2;
710
- };
711
-
712
- export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
461
+ }
462
+ export function __wbg_stack_3b0d974bbf31e44f(arg0, arg1) {
713
463
  const ret = arg1.stack;
714
464
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
715
465
  const len1 = WASM_VECTOR_LEN;
716
466
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
717
467
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
718
- };
719
-
720
- export function __wbg_value_692627309814bb8c(arg0) {
468
+ }
469
+ export function __wbg_value_3d3defe09fb1ffca(arg0) {
721
470
  const ret = arg0.value;
722
471
  return ret;
723
- };
724
-
725
- export function __wbg_warn_1d74dddbe2fd1dbb(arg0) {
472
+ }
473
+ export function __wbg_warn_633bacc13ba7e6c3(arg0) {
726
474
  console.warn(arg0);
727
- };
728
-
729
- export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
475
+ }
476
+ export function __wbindgen_cast_0000000000000001(arg0) {
477
+ // Cast intrinsic for `F64 -> Externref`.
478
+ const ret = arg0;
479
+ return ret;
480
+ }
481
+ export function __wbindgen_cast_0000000000000002(arg0) {
482
+ // Cast intrinsic for `I64 -> Externref`.
483
+ const ret = arg0;
484
+ return ret;
485
+ }
486
+ export function __wbindgen_cast_0000000000000003(arg0, arg1) {
730
487
  // Cast intrinsic for `Ref(String) -> Externref`.
731
488
  const ret = getStringFromWasm0(arg0, arg1);
732
489
  return ret;
733
- };
734
-
735
- export function __wbindgen_cast_4625c577ab2ec9ee(arg0) {
490
+ }
491
+ export function __wbindgen_cast_0000000000000004(arg0) {
736
492
  // Cast intrinsic for `U64 -> Externref`.
737
493
  const ret = BigInt.asUintN(64, arg0);
738
494
  return ret;
739
- };
740
-
741
- export function __wbindgen_cast_9ae0607507abb057(arg0) {
742
- // Cast intrinsic for `I64 -> Externref`.
743
- const ret = arg0;
744
- return ret;
745
- };
746
-
747
- export function __wbindgen_cast_d6cd19b81560fd6e(arg0) {
748
- // Cast intrinsic for `F64 -> Externref`.
749
- const ret = arg0;
750
- return ret;
751
- };
752
-
495
+ }
753
496
  export function __wbindgen_init_externref_table() {
754
497
  const table = wasm.__wbindgen_externrefs;
755
498
  const offset = table.grow(4);
@@ -758,6 +501,194 @@ export function __wbindgen_init_externref_table() {
758
501
  table.set(offset + 1, null);
759
502
  table.set(offset + 2, true);
760
503
  table.set(offset + 3, false);
761
- ;
762
- };
504
+ }
505
+ const WorkspaceFinalization = (typeof FinalizationRegistry === 'undefined')
506
+ ? { register: () => {}, unregister: () => {} }
507
+ : new FinalizationRegistry(ptr => wasm.__wbg_workspace_free(ptr, 1));
763
508
 
509
+ function addToExternrefTable0(obj) {
510
+ const idx = wasm.__externref_table_alloc();
511
+ wasm.__wbindgen_externrefs.set(idx, obj);
512
+ return idx;
513
+ }
514
+
515
+ function debugString(val) {
516
+ // primitive types
517
+ const type = typeof val;
518
+ if (type == 'number' || type == 'boolean' || val == null) {
519
+ return `${val}`;
520
+ }
521
+ if (type == 'string') {
522
+ return `"${val}"`;
523
+ }
524
+ if (type == 'symbol') {
525
+ const description = val.description;
526
+ if (description == null) {
527
+ return 'Symbol';
528
+ } else {
529
+ return `Symbol(${description})`;
530
+ }
531
+ }
532
+ if (type == 'function') {
533
+ const name = val.name;
534
+ if (typeof name == 'string' && name.length > 0) {
535
+ return `Function(${name})`;
536
+ } else {
537
+ return 'Function';
538
+ }
539
+ }
540
+ // objects
541
+ if (Array.isArray(val)) {
542
+ const length = val.length;
543
+ let debug = '[';
544
+ if (length > 0) {
545
+ debug += debugString(val[0]);
546
+ }
547
+ for(let i = 1; i < length; i++) {
548
+ debug += ', ' + debugString(val[i]);
549
+ }
550
+ debug += ']';
551
+ return debug;
552
+ }
553
+ // Test for built-in
554
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
555
+ let className;
556
+ if (builtInMatches && builtInMatches.length > 1) {
557
+ className = builtInMatches[1];
558
+ } else {
559
+ // Failed to match the standard '[object ClassName]'
560
+ return toString.call(val);
561
+ }
562
+ if (className == 'Object') {
563
+ // we're a user defined class or Object
564
+ // JSON.stringify avoids problems with cycles, and is generally much
565
+ // easier than looping through ownProperties of `val`.
566
+ try {
567
+ return 'Object(' + JSON.stringify(val) + ')';
568
+ } catch (_) {
569
+ return 'Object';
570
+ }
571
+ }
572
+ // errors
573
+ if (val instanceof Error) {
574
+ return `${val.name}: ${val.message}\n${val.stack}`;
575
+ }
576
+ // TODO we could test for more things here, like `Set`s and `Map`s.
577
+ return className;
578
+ }
579
+
580
+ function getArrayU8FromWasm0(ptr, len) {
581
+ ptr = ptr >>> 0;
582
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
583
+ }
584
+
585
+ let cachedDataViewMemory0 = null;
586
+ function getDataViewMemory0() {
587
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
588
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
589
+ }
590
+ return cachedDataViewMemory0;
591
+ }
592
+
593
+ function getStringFromWasm0(ptr, len) {
594
+ return decodeText(ptr >>> 0, len);
595
+ }
596
+
597
+ let cachedUint8ArrayMemory0 = null;
598
+ function getUint8ArrayMemory0() {
599
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
600
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
601
+ }
602
+ return cachedUint8ArrayMemory0;
603
+ }
604
+
605
+ function handleError(f, args) {
606
+ try {
607
+ return f.apply(this, args);
608
+ } catch (e) {
609
+ const idx = addToExternrefTable0(e);
610
+ wasm.__wbindgen_exn_store(idx);
611
+ }
612
+ }
613
+
614
+ function isLikeNone(x) {
615
+ return x === undefined || x === null;
616
+ }
617
+
618
+ function passStringToWasm0(arg, malloc, realloc) {
619
+ if (realloc === undefined) {
620
+ const buf = cachedTextEncoder.encode(arg);
621
+ const ptr = malloc(buf.length, 1) >>> 0;
622
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
623
+ WASM_VECTOR_LEN = buf.length;
624
+ return ptr;
625
+ }
626
+
627
+ let len = arg.length;
628
+ let ptr = malloc(len, 1) >>> 0;
629
+
630
+ const mem = getUint8ArrayMemory0();
631
+
632
+ let offset = 0;
633
+
634
+ for (; offset < len; offset++) {
635
+ const code = arg.charCodeAt(offset);
636
+ if (code > 0x7F) break;
637
+ mem[ptr + offset] = code;
638
+ }
639
+ if (offset !== len) {
640
+ if (offset !== 0) {
641
+ arg = arg.slice(offset);
642
+ }
643
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
644
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
645
+ const ret = cachedTextEncoder.encodeInto(arg, view);
646
+
647
+ offset += ret.written;
648
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
649
+ }
650
+
651
+ WASM_VECTOR_LEN = offset;
652
+ return ptr;
653
+ }
654
+
655
+ function takeFromExternrefTable0(idx) {
656
+ const value = wasm.__wbindgen_externrefs.get(idx);
657
+ wasm.__externref_table_dealloc(idx);
658
+ return value;
659
+ }
660
+
661
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
662
+ cachedTextDecoder.decode();
663
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
664
+ let numBytesDecoded = 0;
665
+ function decodeText(ptr, len) {
666
+ numBytesDecoded += len;
667
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
668
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
669
+ cachedTextDecoder.decode();
670
+ numBytesDecoded = len;
671
+ }
672
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
673
+ }
674
+
675
+ const cachedTextEncoder = new TextEncoder();
676
+
677
+ if (!('encodeInto' in cachedTextEncoder)) {
678
+ cachedTextEncoder.encodeInto = function (arg, view) {
679
+ const buf = cachedTextEncoder.encode(arg);
680
+ view.set(buf);
681
+ return {
682
+ read: arg.length,
683
+ written: buf.length
684
+ };
685
+ };
686
+ }
687
+
688
+ let WASM_VECTOR_LEN = 0;
689
+
690
+
691
+ let wasm;
692
+ export function __wbg_set_wasm(val) {
693
+ wasm = val;
694
+ }
package/ruff_wasm_bg.wasm CHANGED
Binary file