rregex 1.6.0 → 1.7.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 +15 -13
- package/lib/browser.js +114 -97
- package/lib/commonjs.d.ts +2 -2
- package/lib/commonjs.js +86 -78
- package/lib/module.d.ts +2 -2
- package/lib/module.js +89 -77
- package/lib/rregex.wasm +0 -0
- package/lib/rregex.wasm.d.ts +7 -7
- package/lib/types.d.ts +15 -13
- package/package.json +1 -1
package/lib/module.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
let wasm;
|
|
2
|
+
export function __wbg_set_wasm(val) {
|
|
3
|
+
wasm = val;
|
|
4
|
+
}
|
|
5
|
+
|
|
2
6
|
|
|
3
|
-
const heap = new Array(
|
|
7
|
+
const heap = new Array(128).fill(undefined);
|
|
4
8
|
|
|
5
9
|
heap.push(undefined, null, true, false);
|
|
6
10
|
|
|
@@ -9,7 +13,7 @@ function getObject(idx) { return heap[idx]; }
|
|
|
9
13
|
let heap_next = heap.length;
|
|
10
14
|
|
|
11
15
|
function dropObject(idx) {
|
|
12
|
-
if (idx <
|
|
16
|
+
if (idx < 132) return;
|
|
13
17
|
heap[idx] = heap_next;
|
|
14
18
|
heap_next = idx;
|
|
15
19
|
}
|
|
@@ -26,15 +30,17 @@ let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true
|
|
|
26
30
|
|
|
27
31
|
cachedTextDecoder.decode();
|
|
28
32
|
|
|
29
|
-
let cachedUint8Memory0;
|
|
33
|
+
let cachedUint8Memory0 = null;
|
|
34
|
+
|
|
30
35
|
function getUint8Memory0() {
|
|
31
|
-
if (cachedUint8Memory0.byteLength === 0) {
|
|
36
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
32
37
|
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
33
38
|
}
|
|
34
39
|
return cachedUint8Memory0;
|
|
35
40
|
}
|
|
36
41
|
|
|
37
42
|
function getStringFromWasm0(ptr, len) {
|
|
43
|
+
ptr = ptr >>> 0;
|
|
38
44
|
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
39
45
|
}
|
|
40
46
|
|
|
@@ -70,14 +76,14 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
70
76
|
|
|
71
77
|
if (realloc === undefined) {
|
|
72
78
|
const buf = cachedTextEncoder.encode(arg);
|
|
73
|
-
const ptr = malloc(buf.length);
|
|
79
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
74
80
|
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
75
81
|
WASM_VECTOR_LEN = buf.length;
|
|
76
82
|
return ptr;
|
|
77
83
|
}
|
|
78
84
|
|
|
79
85
|
let len = arg.length;
|
|
80
|
-
let ptr = malloc(len);
|
|
86
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
81
87
|
|
|
82
88
|
const mem = getUint8Memory0();
|
|
83
89
|
|
|
@@ -93,7 +99,7 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
93
99
|
if (offset !== 0) {
|
|
94
100
|
arg = arg.slice(offset);
|
|
95
101
|
}
|
|
96
|
-
ptr = realloc(ptr, len, len = offset + arg.length * 3);
|
|
102
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
97
103
|
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
|
98
104
|
const ret = encodeString(arg, view);
|
|
99
105
|
|
|
@@ -108,9 +114,10 @@ function isLikeNone(x) {
|
|
|
108
114
|
return x === undefined || x === null;
|
|
109
115
|
}
|
|
110
116
|
|
|
111
|
-
let cachedInt32Memory0;
|
|
117
|
+
let cachedInt32Memory0 = null;
|
|
118
|
+
|
|
112
119
|
function getInt32Memory0() {
|
|
113
|
-
if (cachedInt32Memory0.byteLength === 0) {
|
|
120
|
+
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
114
121
|
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
115
122
|
}
|
|
116
123
|
return cachedInt32Memory0;
|
|
@@ -180,11 +187,21 @@ function debugString(val) {
|
|
|
180
187
|
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
181
188
|
return className;
|
|
182
189
|
}
|
|
190
|
+
|
|
191
|
+
let stack_pointer = 128;
|
|
192
|
+
|
|
193
|
+
function addBorrowedObject(obj) {
|
|
194
|
+
if (stack_pointer == 1) throw new Error('out of js stack');
|
|
195
|
+
heap[--stack_pointer] = obj;
|
|
196
|
+
return stack_pointer;
|
|
197
|
+
}
|
|
183
198
|
/**
|
|
184
199
|
* @param {string} text
|
|
185
200
|
* @returns {string}
|
|
186
201
|
*/
|
|
187
202
|
export function escape(text) {
|
|
203
|
+
let deferred2_0;
|
|
204
|
+
let deferred2_1;
|
|
188
205
|
try {
|
|
189
206
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
190
207
|
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -192,21 +209,15 @@ export function escape(text) {
|
|
|
192
209
|
wasm.escape(retptr, ptr0, len0);
|
|
193
210
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
194
211
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
212
|
+
deferred2_0 = r0;
|
|
213
|
+
deferred2_1 = r1;
|
|
195
214
|
return getStringFromWasm0(r0, r1);
|
|
196
215
|
} finally {
|
|
197
216
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
198
|
-
wasm.__wbindgen_free(
|
|
217
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
199
218
|
}
|
|
200
219
|
}
|
|
201
220
|
|
|
202
|
-
let stack_pointer = 32;
|
|
203
|
-
|
|
204
|
-
function addBorrowedObject(obj) {
|
|
205
|
-
if (stack_pointer == 1) throw new Error('out of js stack');
|
|
206
|
-
heap[--stack_pointer] = obj;
|
|
207
|
-
return stack_pointer;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
221
|
function handleError(f, args) {
|
|
211
222
|
try {
|
|
212
223
|
return f.apply(this, args);
|
|
@@ -220,16 +231,9 @@ function handleError(f, args) {
|
|
|
220
231
|
*/
|
|
221
232
|
export class RRegex {
|
|
222
233
|
|
|
223
|
-
static __wrap(ptr) {
|
|
224
|
-
const obj = Object.create(RRegex.prototype);
|
|
225
|
-
obj.ptr = ptr;
|
|
226
|
-
|
|
227
|
-
return obj;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
234
|
__destroy_into_raw() {
|
|
231
|
-
const ptr = this.
|
|
232
|
-
this.
|
|
235
|
+
const ptr = this.__wbg_ptr;
|
|
236
|
+
this.__wbg_ptr = 0;
|
|
233
237
|
|
|
234
238
|
return ptr;
|
|
235
239
|
}
|
|
@@ -255,7 +259,8 @@ export class RRegex {
|
|
|
255
259
|
if (r2) {
|
|
256
260
|
throw takeObject(r1);
|
|
257
261
|
}
|
|
258
|
-
|
|
262
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
263
|
+
return this;
|
|
259
264
|
} finally {
|
|
260
265
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
261
266
|
}
|
|
@@ -270,7 +275,7 @@ export class RRegex {
|
|
|
270
275
|
isMatch(text) {
|
|
271
276
|
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
272
277
|
const len0 = WASM_VECTOR_LEN;
|
|
273
|
-
const ret = wasm.rregex_isMatch(this.
|
|
278
|
+
const ret = wasm.rregex_isMatch(this.__wbg_ptr, ptr0, len0);
|
|
274
279
|
return ret !== 0;
|
|
275
280
|
}
|
|
276
281
|
/**
|
|
@@ -284,7 +289,7 @@ export class RRegex {
|
|
|
284
289
|
isMatchAt(text, start) {
|
|
285
290
|
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
286
291
|
const len0 = WASM_VECTOR_LEN;
|
|
287
|
-
const ret = wasm.rregex_isMatchAt(this.
|
|
292
|
+
const ret = wasm.rregex_isMatchAt(this.__wbg_ptr, ptr0, len0, start);
|
|
288
293
|
return ret !== 0;
|
|
289
294
|
}
|
|
290
295
|
/**
|
|
@@ -297,7 +302,7 @@ export class RRegex {
|
|
|
297
302
|
find(text) {
|
|
298
303
|
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
299
304
|
const len0 = WASM_VECTOR_LEN;
|
|
300
|
-
const ret = wasm.rregex_find(this.
|
|
305
|
+
const ret = wasm.rregex_find(this.__wbg_ptr, ptr0, len0);
|
|
301
306
|
return takeObject(ret);
|
|
302
307
|
}
|
|
303
308
|
/**
|
|
@@ -311,7 +316,7 @@ export class RRegex {
|
|
|
311
316
|
findAt(text, start) {
|
|
312
317
|
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
313
318
|
const len0 = WASM_VECTOR_LEN;
|
|
314
|
-
const ret = wasm.rregex_findAt(this.
|
|
319
|
+
const ret = wasm.rregex_findAt(this.__wbg_ptr, ptr0, len0, start);
|
|
315
320
|
return takeObject(ret);
|
|
316
321
|
}
|
|
317
322
|
/**
|
|
@@ -323,7 +328,7 @@ export class RRegex {
|
|
|
323
328
|
findAll(text) {
|
|
324
329
|
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
325
330
|
const len0 = WASM_VECTOR_LEN;
|
|
326
|
-
const ret = wasm.rregex_findAll(this.
|
|
331
|
+
const ret = wasm.rregex_findAll(this.__wbg_ptr, ptr0, len0);
|
|
327
332
|
return takeObject(ret);
|
|
328
333
|
}
|
|
329
334
|
/**
|
|
@@ -336,19 +341,23 @@ export class RRegex {
|
|
|
336
341
|
* @returns {string}
|
|
337
342
|
*/
|
|
338
343
|
replace(text, rep) {
|
|
344
|
+
let deferred3_0;
|
|
345
|
+
let deferred3_1;
|
|
339
346
|
try {
|
|
340
347
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
341
348
|
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
342
349
|
const len0 = WASM_VECTOR_LEN;
|
|
343
350
|
const ptr1 = passStringToWasm0(rep, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
344
351
|
const len1 = WASM_VECTOR_LEN;
|
|
345
|
-
wasm.rregex_replace(retptr, this.
|
|
352
|
+
wasm.rregex_replace(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
346
353
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
347
354
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
355
|
+
deferred3_0 = r0;
|
|
356
|
+
deferred3_1 = r1;
|
|
348
357
|
return getStringFromWasm0(r0, r1);
|
|
349
358
|
} finally {
|
|
350
359
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
351
|
-
wasm.__wbindgen_free(
|
|
360
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
352
361
|
}
|
|
353
362
|
}
|
|
354
363
|
/**
|
|
@@ -361,19 +370,23 @@ export class RRegex {
|
|
|
361
370
|
* @returns {string}
|
|
362
371
|
*/
|
|
363
372
|
replacen(text, limit, rep) {
|
|
373
|
+
let deferred3_0;
|
|
374
|
+
let deferred3_1;
|
|
364
375
|
try {
|
|
365
376
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
366
377
|
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
367
378
|
const len0 = WASM_VECTOR_LEN;
|
|
368
379
|
const ptr1 = passStringToWasm0(rep, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
369
380
|
const len1 = WASM_VECTOR_LEN;
|
|
370
|
-
wasm.rregex_replacen(retptr, this.
|
|
381
|
+
wasm.rregex_replacen(retptr, this.__wbg_ptr, ptr0, len0, limit, ptr1, len1);
|
|
371
382
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
372
383
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
384
|
+
deferred3_0 = r0;
|
|
385
|
+
deferred3_1 = r1;
|
|
373
386
|
return getStringFromWasm0(r0, r1);
|
|
374
387
|
} finally {
|
|
375
388
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
376
|
-
wasm.__wbindgen_free(
|
|
389
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
377
390
|
}
|
|
378
391
|
}
|
|
379
392
|
/**
|
|
@@ -385,19 +398,23 @@ export class RRegex {
|
|
|
385
398
|
* @returns {string}
|
|
386
399
|
*/
|
|
387
400
|
replaceAll(text, rep) {
|
|
401
|
+
let deferred3_0;
|
|
402
|
+
let deferred3_1;
|
|
388
403
|
try {
|
|
389
404
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
390
405
|
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
391
406
|
const len0 = WASM_VECTOR_LEN;
|
|
392
407
|
const ptr1 = passStringToWasm0(rep, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
393
408
|
const len1 = WASM_VECTOR_LEN;
|
|
394
|
-
wasm.rregex_replaceAll(retptr, this.
|
|
409
|
+
wasm.rregex_replaceAll(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
395
410
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
396
411
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
412
|
+
deferred3_0 = r0;
|
|
413
|
+
deferred3_1 = r1;
|
|
397
414
|
return getStringFromWasm0(r0, r1);
|
|
398
415
|
} finally {
|
|
399
416
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
400
|
-
wasm.__wbindgen_free(
|
|
417
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
401
418
|
}
|
|
402
419
|
}
|
|
403
420
|
/**
|
|
@@ -410,7 +427,7 @@ export class RRegex {
|
|
|
410
427
|
split(text) {
|
|
411
428
|
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
412
429
|
const len0 = WASM_VECTOR_LEN;
|
|
413
|
-
const ret = wasm.rregex_split(this.
|
|
430
|
+
const ret = wasm.rregex_split(this.__wbg_ptr, ptr0, len0);
|
|
414
431
|
return takeObject(ret);
|
|
415
432
|
}
|
|
416
433
|
/**
|
|
@@ -424,7 +441,7 @@ export class RRegex {
|
|
|
424
441
|
splitn(text, limit) {
|
|
425
442
|
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
426
443
|
const len0 = WASM_VECTOR_LEN;
|
|
427
|
-
const ret = wasm.rregex_splitn(this.
|
|
444
|
+
const ret = wasm.rregex_splitn(this.__wbg_ptr, ptr0, len0, limit);
|
|
428
445
|
return takeObject(ret);
|
|
429
446
|
}
|
|
430
447
|
/**
|
|
@@ -439,7 +456,7 @@ export class RRegex {
|
|
|
439
456
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
440
457
|
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
441
458
|
const len0 = WASM_VECTOR_LEN;
|
|
442
|
-
wasm.rregex_shortestMatch(retptr, this.
|
|
459
|
+
wasm.rregex_shortestMatch(retptr, this.__wbg_ptr, ptr0, len0);
|
|
443
460
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
444
461
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
445
462
|
return r0 === 0 ? undefined : r1 >>> 0;
|
|
@@ -460,7 +477,7 @@ export class RRegex {
|
|
|
460
477
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
461
478
|
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
462
479
|
const len0 = WASM_VECTOR_LEN;
|
|
463
|
-
wasm.rregex_shortestMatchAt(retptr, this.
|
|
480
|
+
wasm.rregex_shortestMatchAt(retptr, this.__wbg_ptr, ptr0, len0, limit);
|
|
464
481
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
465
482
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
466
483
|
return r0 === 0 ? undefined : r1 >>> 0;
|
|
@@ -473,7 +490,7 @@ export class RRegex {
|
|
|
473
490
|
* @returns {any}
|
|
474
491
|
*/
|
|
475
492
|
syntax() {
|
|
476
|
-
const ret = wasm.rregex_syntax(this.
|
|
493
|
+
const ret = wasm.rregex_syntax(this.__wbg_ptr);
|
|
477
494
|
return takeObject(ret);
|
|
478
495
|
}
|
|
479
496
|
/**
|
|
@@ -481,15 +498,19 @@ export class RRegex {
|
|
|
481
498
|
* @returns {string}
|
|
482
499
|
*/
|
|
483
500
|
toString() {
|
|
501
|
+
let deferred1_0;
|
|
502
|
+
let deferred1_1;
|
|
484
503
|
try {
|
|
485
504
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
486
|
-
wasm.rregex_toString(retptr, this.
|
|
505
|
+
wasm.rregex_toString(retptr, this.__wbg_ptr);
|
|
487
506
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
488
507
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
508
|
+
deferred1_0 = r0;
|
|
509
|
+
deferred1_1 = r1;
|
|
489
510
|
return getStringFromWasm0(r0, r1);
|
|
490
511
|
} finally {
|
|
491
512
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
492
|
-
wasm.__wbindgen_free(
|
|
513
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
493
514
|
}
|
|
494
515
|
}
|
|
495
516
|
}
|
|
@@ -500,16 +521,9 @@ export class RRegex {
|
|
|
500
521
|
*/
|
|
501
522
|
export class RRegexSet {
|
|
502
523
|
|
|
503
|
-
static __wrap(ptr) {
|
|
504
|
-
const obj = Object.create(RRegexSet.prototype);
|
|
505
|
-
obj.ptr = ptr;
|
|
506
|
-
|
|
507
|
-
return obj;
|
|
508
|
-
}
|
|
509
|
-
|
|
510
524
|
__destroy_into_raw() {
|
|
511
|
-
const ptr = this.
|
|
512
|
-
this.
|
|
525
|
+
const ptr = this.__wbg_ptr;
|
|
526
|
+
this.__wbg_ptr = 0;
|
|
513
527
|
|
|
514
528
|
return ptr;
|
|
515
529
|
}
|
|
@@ -532,7 +546,8 @@ export class RRegexSet {
|
|
|
532
546
|
if (r2) {
|
|
533
547
|
throw takeObject(r1);
|
|
534
548
|
}
|
|
535
|
-
|
|
549
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
550
|
+
return this;
|
|
536
551
|
} finally {
|
|
537
552
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
538
553
|
heap[stack_pointer++] = undefined;
|
|
@@ -548,7 +563,7 @@ export class RRegexSet {
|
|
|
548
563
|
isMatch(text) {
|
|
549
564
|
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
550
565
|
const len0 = WASM_VECTOR_LEN;
|
|
551
|
-
const ret = wasm.rregexset_isMatch(this.
|
|
566
|
+
const ret = wasm.rregexset_isMatch(this.__wbg_ptr, ptr0, len0);
|
|
552
567
|
return ret !== 0;
|
|
553
568
|
}
|
|
554
569
|
/**
|
|
@@ -561,7 +576,7 @@ export class RRegexSet {
|
|
|
561
576
|
matches(text) {
|
|
562
577
|
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
563
578
|
const len0 = WASM_VECTOR_LEN;
|
|
564
|
-
const ret = wasm.rregexset_matches(this.
|
|
579
|
+
const ret = wasm.rregexset_matches(this.__wbg_ptr, ptr0, len0);
|
|
565
580
|
return takeObject(ret);
|
|
566
581
|
}
|
|
567
582
|
}
|
|
@@ -588,59 +603,56 @@ export function __wbindgen_is_string(arg0) {
|
|
|
588
603
|
export function __wbindgen_string_get(arg0, arg1) {
|
|
589
604
|
const obj = getObject(arg1);
|
|
590
605
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
591
|
-
var
|
|
592
|
-
var
|
|
593
|
-
getInt32Memory0()[arg0 / 4 + 1] =
|
|
594
|
-
getInt32Memory0()[arg0 / 4 + 0] =
|
|
606
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
607
|
+
var len1 = WASM_VECTOR_LEN;
|
|
608
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
609
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
595
610
|
};
|
|
596
611
|
|
|
597
|
-
export function
|
|
612
|
+
export function __wbg_get_f01601b5a68d10e3(arg0, arg1) {
|
|
598
613
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
599
614
|
return addHeapObject(ret);
|
|
600
615
|
};
|
|
601
616
|
|
|
602
|
-
export function
|
|
617
|
+
export function __wbg_length_1009b1af0c481d7b(arg0) {
|
|
603
618
|
const ret = getObject(arg0).length;
|
|
604
619
|
return ret;
|
|
605
620
|
};
|
|
606
621
|
|
|
607
|
-
export function
|
|
622
|
+
export function __wbg_new_ffc6d4d085022169() {
|
|
608
623
|
const ret = new Array();
|
|
609
624
|
return addHeapObject(ret);
|
|
610
625
|
};
|
|
611
626
|
|
|
612
|
-
export function
|
|
627
|
+
export function __wbg_new_9fb8d994e1c0aaac() {
|
|
613
628
|
const ret = new Object();
|
|
614
629
|
return addHeapObject(ret);
|
|
615
630
|
};
|
|
616
631
|
|
|
617
|
-
export function
|
|
632
|
+
export function __wbg_push_901f3914205d44de(arg0, arg1) {
|
|
618
633
|
const ret = getObject(arg0).push(getObject(arg1));
|
|
619
634
|
return ret;
|
|
620
635
|
};
|
|
621
636
|
|
|
622
|
-
export function
|
|
637
|
+
export function __wbg_new_a64e3f2afc2cf2f8(arg0, arg1) {
|
|
623
638
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
624
639
|
return addHeapObject(ret);
|
|
625
640
|
};
|
|
626
641
|
|
|
627
|
-
export function
|
|
642
|
+
export function __wbg_set_759f75cd92b612d2() { return handleError(function (arg0, arg1, arg2) {
|
|
628
643
|
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
629
644
|
return ret;
|
|
630
645
|
}, arguments) };
|
|
631
646
|
|
|
632
647
|
export function __wbindgen_debug_string(arg0, arg1) {
|
|
633
648
|
const ret = debugString(getObject(arg1));
|
|
634
|
-
const
|
|
635
|
-
const
|
|
636
|
-
getInt32Memory0()[arg0 / 4 + 1] =
|
|
637
|
-
getInt32Memory0()[arg0 / 4 + 0] =
|
|
649
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
650
|
+
const len1 = WASM_VECTOR_LEN;
|
|
651
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
652
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
638
653
|
};
|
|
639
654
|
|
|
640
655
|
export function __wbindgen_throw(arg0, arg1) {
|
|
641
656
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
642
657
|
};
|
|
643
658
|
|
|
644
|
-
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
645
|
-
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
646
|
-
|
package/lib/rregex.wasm
CHANGED
|
Binary file
|
package/lib/rregex.wasm.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
+
export function __wbg_rregexset_free(a: number): void;
|
|
5
|
+
export function rregexset_new(a: number, b: number): void;
|
|
6
|
+
export function rregexset_isMatch(a: number, b: number, c: number): number;
|
|
7
|
+
export function rregexset_matches(a: number, b: number, c: number): number;
|
|
4
8
|
export function escape(a: number, b: number, c: number): void;
|
|
5
9
|
export function __wbg_rregex_free(a: number): void;
|
|
6
10
|
export function rregex_new(a: number, b: number, c: number): void;
|
|
@@ -18,12 +22,8 @@ export function rregex_shortestMatch(a: number, b: number, c: number, d: number)
|
|
|
18
22
|
export function rregex_shortestMatchAt(a: number, b: number, c: number, d: number, e: number): void;
|
|
19
23
|
export function rregex_syntax(a: number): number;
|
|
20
24
|
export function rregex_toString(a: number, b: number): void;
|
|
21
|
-
export function
|
|
22
|
-
export function
|
|
23
|
-
export function rregexset_isMatch(a: number, b: number, c: number): number;
|
|
24
|
-
export function rregexset_matches(a: number, b: number, c: number): number;
|
|
25
|
-
export function __wbindgen_malloc(a: number): number;
|
|
26
|
-
export function __wbindgen_realloc(a: number, b: number, c: number): number;
|
|
25
|
+
export function __wbindgen_malloc(a: number, b: number): number;
|
|
26
|
+
export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number;
|
|
27
27
|
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
|
28
|
-
export function __wbindgen_free(a: number, b: number): void;
|
|
28
|
+
export function __wbindgen_free(a: number, b: number, c: number): void;
|
|
29
29
|
export function __wbindgen_exn_store(a: number): void;
|
package/lib/types.d.ts
CHANGED
|
@@ -503,6 +503,10 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
503
503
|
|
|
504
504
|
export interface InitOutput {
|
|
505
505
|
readonly memory: WebAssembly.Memory;
|
|
506
|
+
readonly __wbg_rregexset_free: (a: number) => void;
|
|
507
|
+
readonly rregexset_new: (a: number, b: number) => void;
|
|
508
|
+
readonly rregexset_isMatch: (a: number, b: number, c: number) => number;
|
|
509
|
+
readonly rregexset_matches: (a: number, b: number, c: number) => number;
|
|
506
510
|
readonly escape: (a: number, b: number, c: number) => void;
|
|
507
511
|
readonly __wbg_rregex_free: (a: number) => void;
|
|
508
512
|
readonly rregex_new: (a: number, b: number, c: number) => void;
|
|
@@ -520,25 +524,23 @@ export interface InitOutput {
|
|
|
520
524
|
readonly rregex_shortestMatchAt: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
521
525
|
readonly rregex_syntax: (a: number) => number;
|
|
522
526
|
readonly rregex_toString: (a: number, b: number) => void;
|
|
523
|
-
readonly
|
|
524
|
-
readonly
|
|
525
|
-
readonly rregexset_isMatch: (a: number, b: number, c: number) => number;
|
|
526
|
-
readonly rregexset_matches: (a: number, b: number, c: number) => number;
|
|
527
|
-
readonly __wbindgen_malloc: (a: number) => number;
|
|
528
|
-
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
|
|
527
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
528
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
529
529
|
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
530
|
-
readonly __wbindgen_free: (a: number, b: number) => void;
|
|
530
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
531
531
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
532
532
|
}
|
|
533
533
|
|
|
534
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
534
535
|
/**
|
|
535
|
-
*
|
|
536
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
537
|
+
* a precompiled `WebAssembly.Module`.
|
|
536
538
|
*
|
|
537
|
-
* @param {
|
|
539
|
+
* @param {SyncInitInput} module
|
|
538
540
|
*
|
|
539
541
|
* @returns {InitOutput}
|
|
540
542
|
*/
|
|
541
|
-
export function initSync(
|
|
543
|
+
export function initSync(module: SyncInitInput): InitOutput;
|
|
542
544
|
|
|
543
545
|
/**
|
|
544
546
|
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
@@ -548,7 +550,7 @@ export function initSync(bytes: BufferSource): InitOutput;
|
|
|
548
550
|
*
|
|
549
551
|
* @returns {Promise<InitOutput>}
|
|
550
552
|
*/
|
|
551
|
-
export default function
|
|
553
|
+
export default function __wbg_init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;
|
|
552
554
|
|
|
553
555
|
export const metadata: {
|
|
554
556
|
"name": "rregex",
|
|
@@ -558,6 +560,6 @@ export const metadata: {
|
|
|
558
560
|
],
|
|
559
561
|
"homepage": "https://2fd.github.io/rregex",
|
|
560
562
|
"repository": "https://github.com/2fd/rregex",
|
|
561
|
-
"regex": "1.
|
|
562
|
-
"regex-syntax": "0.6.
|
|
563
|
+
"regex": "1.7.3",
|
|
564
|
+
"regex-syntax": "0.6.29"
|
|
563
565
|
}
|