rregex 1.5.0 → 1.5.1
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/lib/browser.d.ts +13 -4
- package/lib/browser.js +142 -98
- package/lib/commonjs.d.ts +2 -2
- package/lib/commonjs.js +105 -87
- package/lib/module.d.ts +2 -2
- package/lib/module.js +102 -84
- package/lib/rregex.wasm +0 -0
- package/lib/rregex.wasm.d.ts +2 -2
- package/lib/types.d.ts +13 -4
- package/package.json +1 -1
package/lib/browser.d.ts
CHANGED
|
@@ -505,7 +505,7 @@ export interface InitOutput {
|
|
|
505
505
|
readonly memory: WebAssembly.Memory;
|
|
506
506
|
readonly escape: (a: number, b: number, c: number) => void;
|
|
507
507
|
readonly __wbg_rregex_free: (a: number) => void;
|
|
508
|
-
readonly rregex_new: (a: number, b: number) =>
|
|
508
|
+
readonly rregex_new: (a: number, b: number, c: number) => void;
|
|
509
509
|
readonly rregex_isMatch: (a: number, b: number, c: number) => number;
|
|
510
510
|
readonly rregex_isMatchAt: (a: number, b: number, c: number, d: number) => number;
|
|
511
511
|
readonly rregex_find: (a: number, b: number, c: number) => number;
|
|
@@ -521,7 +521,7 @@ export interface InitOutput {
|
|
|
521
521
|
readonly rregex_syntax: (a: number) => number;
|
|
522
522
|
readonly rregex_toString: (a: number, b: number) => void;
|
|
523
523
|
readonly __wbg_rregexset_free: (a: number) => void;
|
|
524
|
-
readonly rregexset_new: (a: number) =>
|
|
524
|
+
readonly rregexset_new: (a: number, b: number) => void;
|
|
525
525
|
readonly rregexset_isMatch: (a: number, b: number, c: number) => number;
|
|
526
526
|
readonly rregexset_matches: (a: number, b: number, c: number) => number;
|
|
527
527
|
readonly __wbindgen_malloc: (a: number) => number;
|
|
@@ -531,6 +531,15 @@ export interface InitOutput {
|
|
|
531
531
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
532
532
|
}
|
|
533
533
|
|
|
534
|
+
/**
|
|
535
|
+
* Synchronously compiles the given `bytes` and instantiates the WebAssembly module.
|
|
536
|
+
*
|
|
537
|
+
* @param {BufferSource} bytes
|
|
538
|
+
*
|
|
539
|
+
* @returns {InitOutput}
|
|
540
|
+
*/
|
|
541
|
+
export function initSync(bytes: BufferSource): InitOutput;
|
|
542
|
+
|
|
534
543
|
/**
|
|
535
544
|
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
536
545
|
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
@@ -549,6 +558,6 @@ export const metadata: {
|
|
|
549
558
|
],
|
|
550
559
|
"homepage": "https://2fd.github.io/rregex",
|
|
551
560
|
"repository": "https://github.com/2fd/rregex",
|
|
552
|
-
"regex": "1.5.
|
|
553
|
-
"regex-syntax": "0.6.
|
|
561
|
+
"regex": "1.5.6",
|
|
562
|
+
"regex-syntax": "0.6.26"
|
|
554
563
|
}
|
package/lib/browser.js
CHANGED
|
@@ -21,16 +21,16 @@ function takeObject(idx) {
|
|
|
21
21
|
return ret;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
25
25
|
|
|
26
26
|
cachedTextDecoder.decode();
|
|
27
27
|
|
|
28
|
-
let
|
|
28
|
+
let cachedUint8Memory0;
|
|
29
29
|
function getUint8Memory0() {
|
|
30
|
-
if (
|
|
31
|
-
|
|
30
|
+
if (cachedUint8Memory0.byteLength === 0) {
|
|
31
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
32
32
|
}
|
|
33
|
-
return
|
|
33
|
+
return cachedUint8Memory0;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
function getStringFromWasm0(ptr, len) {
|
|
@@ -48,7 +48,7 @@ function addHeapObject(obj) {
|
|
|
48
48
|
|
|
49
49
|
let WASM_VECTOR_LEN = 0;
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
const cachedTextEncoder = new TextEncoder('utf-8');
|
|
52
52
|
|
|
53
53
|
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
54
54
|
? function (arg, view) {
|
|
@@ -105,12 +105,12 @@ function isLikeNone(x) {
|
|
|
105
105
|
return x === undefined || x === null;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
let
|
|
108
|
+
let cachedInt32Memory0;
|
|
109
109
|
function getInt32Memory0() {
|
|
110
|
-
if (
|
|
111
|
-
|
|
110
|
+
if (cachedInt32Memory0.byteLength === 0) {
|
|
111
|
+
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
112
112
|
}
|
|
113
|
-
return
|
|
113
|
+
return cachedInt32Memory0;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
function debugString(val) {
|
|
@@ -184,8 +184,8 @@ function debugString(val) {
|
|
|
184
184
|
export function escape(text) {
|
|
185
185
|
try {
|
|
186
186
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
187
|
-
|
|
188
|
-
|
|
187
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
188
|
+
const len0 = WASM_VECTOR_LEN;
|
|
189
189
|
wasm.escape(retptr, ptr0, len0);
|
|
190
190
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
191
191
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
@@ -241,10 +241,21 @@ export class RRegex {
|
|
|
241
241
|
* @param {string} re
|
|
242
242
|
*/
|
|
243
243
|
constructor(re) {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
244
|
+
try {
|
|
245
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
246
|
+
const ptr0 = passStringToWasm0(re, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
247
|
+
const len0 = WASM_VECTOR_LEN;
|
|
248
|
+
wasm.rregex_new(retptr, ptr0, len0);
|
|
249
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
250
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
251
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
252
|
+
if (r2) {
|
|
253
|
+
throw takeObject(r1);
|
|
254
|
+
}
|
|
255
|
+
return RRegex.__wrap(r0);
|
|
256
|
+
} finally {
|
|
257
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
258
|
+
}
|
|
248
259
|
}
|
|
249
260
|
/**
|
|
250
261
|
* Returns true if and only if there is a match for the regex in the string given.
|
|
@@ -254,9 +265,9 @@ export class RRegex {
|
|
|
254
265
|
* @returns {boolean}
|
|
255
266
|
*/
|
|
256
267
|
isMatch(text) {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
268
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
269
|
+
const len0 = WASM_VECTOR_LEN;
|
|
270
|
+
const ret = wasm.rregex_isMatch(this.ptr, ptr0, len0);
|
|
260
271
|
return ret !== 0;
|
|
261
272
|
}
|
|
262
273
|
/**
|
|
@@ -268,9 +279,9 @@ export class RRegex {
|
|
|
268
279
|
* @returns {boolean}
|
|
269
280
|
*/
|
|
270
281
|
isMatchAt(text, start) {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
282
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
283
|
+
const len0 = WASM_VECTOR_LEN;
|
|
284
|
+
const ret = wasm.rregex_isMatchAt(this.ptr, ptr0, len0, start);
|
|
274
285
|
return ret !== 0;
|
|
275
286
|
}
|
|
276
287
|
/**
|
|
@@ -281,9 +292,9 @@ export class RRegex {
|
|
|
281
292
|
* @returns {any}
|
|
282
293
|
*/
|
|
283
294
|
find(text) {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
295
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
296
|
+
const len0 = WASM_VECTOR_LEN;
|
|
297
|
+
const ret = wasm.rregex_find(this.ptr, ptr0, len0);
|
|
287
298
|
return takeObject(ret);
|
|
288
299
|
}
|
|
289
300
|
/**
|
|
@@ -295,9 +306,9 @@ export class RRegex {
|
|
|
295
306
|
* @returns {any}
|
|
296
307
|
*/
|
|
297
308
|
findAt(text, start) {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
309
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
310
|
+
const len0 = WASM_VECTOR_LEN;
|
|
311
|
+
const ret = wasm.rregex_findAt(this.ptr, ptr0, len0, start);
|
|
301
312
|
return takeObject(ret);
|
|
302
313
|
}
|
|
303
314
|
/**
|
|
@@ -307,9 +318,9 @@ export class RRegex {
|
|
|
307
318
|
* @returns {any}
|
|
308
319
|
*/
|
|
309
320
|
findAll(text) {
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
321
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
322
|
+
const len0 = WASM_VECTOR_LEN;
|
|
323
|
+
const ret = wasm.rregex_findAll(this.ptr, ptr0, len0);
|
|
313
324
|
return takeObject(ret);
|
|
314
325
|
}
|
|
315
326
|
/**
|
|
@@ -324,10 +335,10 @@ export class RRegex {
|
|
|
324
335
|
replace(text, rep) {
|
|
325
336
|
try {
|
|
326
337
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
338
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
339
|
+
const len0 = WASM_VECTOR_LEN;
|
|
340
|
+
const ptr1 = passStringToWasm0(rep, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
341
|
+
const len1 = WASM_VECTOR_LEN;
|
|
331
342
|
wasm.rregex_replace(retptr, this.ptr, ptr0, len0, ptr1, len1);
|
|
332
343
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
333
344
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
@@ -349,10 +360,10 @@ export class RRegex {
|
|
|
349
360
|
replacen(text, limit, rep) {
|
|
350
361
|
try {
|
|
351
362
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
363
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
364
|
+
const len0 = WASM_VECTOR_LEN;
|
|
365
|
+
const ptr1 = passStringToWasm0(rep, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
366
|
+
const len1 = WASM_VECTOR_LEN;
|
|
356
367
|
wasm.rregex_replacen(retptr, this.ptr, ptr0, len0, limit, ptr1, len1);
|
|
357
368
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
358
369
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
@@ -373,10 +384,10 @@ export class RRegex {
|
|
|
373
384
|
replaceAll(text, rep) {
|
|
374
385
|
try {
|
|
375
386
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
387
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
388
|
+
const len0 = WASM_VECTOR_LEN;
|
|
389
|
+
const ptr1 = passStringToWasm0(rep, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
390
|
+
const len1 = WASM_VECTOR_LEN;
|
|
380
391
|
wasm.rregex_replaceAll(retptr, this.ptr, ptr0, len0, ptr1, len1);
|
|
381
392
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
382
393
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
@@ -394,9 +405,9 @@ export class RRegex {
|
|
|
394
405
|
* @returns {any}
|
|
395
406
|
*/
|
|
396
407
|
split(text) {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
408
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
409
|
+
const len0 = WASM_VECTOR_LEN;
|
|
410
|
+
const ret = wasm.rregex_split(this.ptr, ptr0, len0);
|
|
400
411
|
return takeObject(ret);
|
|
401
412
|
}
|
|
402
413
|
/**
|
|
@@ -408,9 +419,9 @@ export class RRegex {
|
|
|
408
419
|
* @returns {any}
|
|
409
420
|
*/
|
|
410
421
|
splitn(text, limit) {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
422
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
423
|
+
const len0 = WASM_VECTOR_LEN;
|
|
424
|
+
const ret = wasm.rregex_splitn(this.ptr, ptr0, len0, limit);
|
|
414
425
|
return takeObject(ret);
|
|
415
426
|
}
|
|
416
427
|
/**
|
|
@@ -423,8 +434,8 @@ export class RRegex {
|
|
|
423
434
|
shortestMatch(text) {
|
|
424
435
|
try {
|
|
425
436
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
426
|
-
|
|
427
|
-
|
|
437
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
438
|
+
const len0 = WASM_VECTOR_LEN;
|
|
428
439
|
wasm.rregex_shortestMatch(retptr, this.ptr, ptr0, len0);
|
|
429
440
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
430
441
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
@@ -444,8 +455,8 @@ export class RRegex {
|
|
|
444
455
|
shortestMatchAt(text, limit) {
|
|
445
456
|
try {
|
|
446
457
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
447
|
-
|
|
448
|
-
|
|
458
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
459
|
+
const len0 = WASM_VECTOR_LEN;
|
|
449
460
|
wasm.rregex_shortestMatchAt(retptr, this.ptr, ptr0, len0, limit);
|
|
450
461
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
451
462
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
@@ -459,7 +470,7 @@ export class RRegex {
|
|
|
459
470
|
* @returns {any}
|
|
460
471
|
*/
|
|
461
472
|
syntax() {
|
|
462
|
-
|
|
473
|
+
const ret = wasm.rregex_syntax(this.ptr);
|
|
463
474
|
return takeObject(ret);
|
|
464
475
|
}
|
|
465
476
|
/**
|
|
@@ -510,9 +521,17 @@ export class RRegexSet {
|
|
|
510
521
|
*/
|
|
511
522
|
constructor(list) {
|
|
512
523
|
try {
|
|
513
|
-
|
|
514
|
-
|
|
524
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
525
|
+
wasm.rregexset_new(retptr, addBorrowedObject(list));
|
|
526
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
527
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
528
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
529
|
+
if (r2) {
|
|
530
|
+
throw takeObject(r1);
|
|
531
|
+
}
|
|
532
|
+
return RRegexSet.__wrap(r0);
|
|
515
533
|
} finally {
|
|
534
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
516
535
|
heap[stack_pointer++] = undefined;
|
|
517
536
|
}
|
|
518
537
|
}
|
|
@@ -524,9 +543,9 @@ export class RRegexSet {
|
|
|
524
543
|
* @returns {boolean}
|
|
525
544
|
*/
|
|
526
545
|
isMatch(text) {
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
546
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
547
|
+
const len0 = WASM_VECTOR_LEN;
|
|
548
|
+
const ret = wasm.rregexset_isMatch(this.ptr, ptr0, len0);
|
|
530
549
|
return ret !== 0;
|
|
531
550
|
}
|
|
532
551
|
/**
|
|
@@ -537,9 +556,9 @@ export class RRegexSet {
|
|
|
537
556
|
* @returns {any}
|
|
538
557
|
*/
|
|
539
558
|
matches(text) {
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
559
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
560
|
+
const len0 = WASM_VECTOR_LEN;
|
|
561
|
+
const ret = wasm.rregexset_matches(this.ptr, ptr0, len0);
|
|
543
562
|
return takeObject(ret);
|
|
544
563
|
}
|
|
545
564
|
}
|
|
@@ -575,93 +594,118 @@ async function load(module, imports) {
|
|
|
575
594
|
}
|
|
576
595
|
}
|
|
577
596
|
|
|
578
|
-
|
|
579
|
-
if (typeof input === 'undefined') {
|
|
580
|
-
input = new URL('rregex.wasm', import.meta.url);
|
|
581
|
-
}
|
|
597
|
+
function getImports() {
|
|
582
598
|
const imports = {};
|
|
583
599
|
imports.wbg = {};
|
|
584
600
|
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
585
601
|
takeObject(arg0);
|
|
586
602
|
};
|
|
587
603
|
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
588
|
-
|
|
604
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
589
605
|
return addHeapObject(ret);
|
|
590
606
|
};
|
|
591
607
|
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
592
|
-
|
|
608
|
+
const ret = arg0;
|
|
593
609
|
return addHeapObject(ret);
|
|
594
610
|
};
|
|
595
611
|
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
596
|
-
|
|
612
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
597
613
|
return ret;
|
|
598
614
|
};
|
|
599
615
|
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
600
616
|
const obj = getObject(arg1);
|
|
601
|
-
|
|
617
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
602
618
|
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
603
619
|
var len0 = WASM_VECTOR_LEN;
|
|
604
620
|
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
605
621
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
606
622
|
};
|
|
607
|
-
imports.wbg.
|
|
608
|
-
|
|
623
|
+
imports.wbg.__wbg_get_f0f4f1608ebf633e = function(arg0, arg1) {
|
|
624
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
609
625
|
return addHeapObject(ret);
|
|
610
626
|
};
|
|
611
|
-
imports.wbg.
|
|
612
|
-
|
|
627
|
+
imports.wbg.__wbg_length_93debb0e2e184ab6 = function(arg0) {
|
|
628
|
+
const ret = getObject(arg0).length;
|
|
613
629
|
return ret;
|
|
614
630
|
};
|
|
615
|
-
imports.wbg.
|
|
616
|
-
|
|
631
|
+
imports.wbg.__wbg_new_2ab697f1555e0dbc = function() {
|
|
632
|
+
const ret = new Array();
|
|
617
633
|
return addHeapObject(ret);
|
|
618
634
|
};
|
|
619
|
-
imports.wbg.
|
|
620
|
-
|
|
635
|
+
imports.wbg.__wbg_new_306ce8d57919e6ae = function() {
|
|
636
|
+
const ret = new Object();
|
|
621
637
|
return addHeapObject(ret);
|
|
622
638
|
};
|
|
623
|
-
imports.wbg.
|
|
624
|
-
|
|
639
|
+
imports.wbg.__wbg_push_811c8b08bf4ff9d5 = function(arg0, arg1) {
|
|
640
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
625
641
|
return ret;
|
|
626
642
|
};
|
|
627
|
-
imports.wbg.
|
|
628
|
-
|
|
643
|
+
imports.wbg.__wbg_new_651776e932b7e9c7 = function(arg0, arg1) {
|
|
644
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
629
645
|
return addHeapObject(ret);
|
|
630
646
|
};
|
|
631
|
-
imports.wbg.
|
|
632
|
-
|
|
647
|
+
imports.wbg.__wbg_set_b12cd0ab82903c2f = function() { return handleError(function (arg0, arg1, arg2) {
|
|
648
|
+
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
633
649
|
return ret;
|
|
634
650
|
}, arguments) };
|
|
635
651
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
652
|
+
const ret = debugString(getObject(arg1));
|
|
653
|
+
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
654
|
+
const len0 = WASM_VECTOR_LEN;
|
|
639
655
|
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
640
656
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
641
657
|
};
|
|
642
658
|
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
643
659
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
644
660
|
};
|
|
645
|
-
imports.wbg.__wbindgen_rethrow = function(arg0) {
|
|
646
|
-
throw takeObject(arg0);
|
|
647
|
-
};
|
|
648
|
-
|
|
649
|
-
if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
|
|
650
|
-
input = fetch(input);
|
|
651
|
-
}
|
|
652
661
|
|
|
662
|
+
return imports;
|
|
663
|
+
}
|
|
653
664
|
|
|
665
|
+
function initMemory(imports, maybe_memory) {
|
|
654
666
|
|
|
655
|
-
|
|
667
|
+
}
|
|
656
668
|
|
|
669
|
+
function finalizeInit(instance, module) {
|
|
657
670
|
wasm = instance.exports;
|
|
658
671
|
init.__wbindgen_wasm_module = module;
|
|
672
|
+
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
673
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
674
|
+
|
|
659
675
|
|
|
660
676
|
return wasm;
|
|
661
677
|
}
|
|
662
678
|
|
|
663
|
-
|
|
679
|
+
function initSync(bytes) {
|
|
680
|
+
const imports = getImports();
|
|
681
|
+
|
|
682
|
+
initMemory(imports);
|
|
683
|
+
|
|
684
|
+
const module = new WebAssembly.Module(bytes);
|
|
685
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
664
686
|
|
|
687
|
+
return finalizeInit(instance, module);
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
async function init(input) {
|
|
691
|
+
if (typeof input === 'undefined') {
|
|
692
|
+
input = new URL('rregex.wasm', import.meta.url);
|
|
693
|
+
}
|
|
694
|
+
const imports = getImports();
|
|
695
|
+
|
|
696
|
+
if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
|
|
697
|
+
input = fetch(input);
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
initMemory(imports);
|
|
701
|
+
|
|
702
|
+
const { instance, module } = await load(await input, imports);
|
|
703
|
+
|
|
704
|
+
return finalizeInit(instance, module);
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
export { initSync }
|
|
708
|
+
export default init;
|
|
665
709
|
|
|
666
710
|
export const metadata = {
|
|
667
711
|
"name": "rregex",
|
|
@@ -671,6 +715,6 @@ export const metadata = {
|
|
|
671
715
|
],
|
|
672
716
|
"homepage": "https://2fd.github.io/rregex",
|
|
673
717
|
"repository": "https://github.com/2fd/rregex",
|
|
674
|
-
"regex": "1.5.
|
|
675
|
-
"regex-syntax": "0.6.
|
|
718
|
+
"regex": "1.5.6",
|
|
719
|
+
"regex-syntax": "0.6.26"
|
|
676
720
|
}
|
package/lib/commonjs.d.ts
CHANGED