rregex 1.3.0 → 1.3.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.
@@ -0,0 +1,609 @@
1
+
2
+ let imports = {};
3
+ imports['wbg'] = module.exports;
4
+ let wasm;
5
+ const { TextDecoder, TextEncoder } = require(`util`);
6
+
7
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
8
+
9
+ cachedTextDecoder.decode();
10
+
11
+ let cachedUint8ArrayMemory0 = null;
12
+
13
+ function getUint8ArrayMemory0() {
14
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
15
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
16
+ }
17
+ return cachedUint8ArrayMemory0;
18
+ }
19
+
20
+ function getStringFromWasm0(ptr, len) {
21
+ ptr = ptr >>> 0;
22
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
23
+ }
24
+
25
+ function addToExternrefTable0(obj) {
26
+ const idx = wasm.__externref_table_alloc();
27
+ wasm.__wbindgen_export_2.set(idx, obj);
28
+ return idx;
29
+ }
30
+
31
+ function handleError(f, args) {
32
+ try {
33
+ return f.apply(this, args);
34
+ } catch (e) {
35
+ const idx = addToExternrefTable0(e);
36
+ wasm.__wbindgen_exn_store(idx);
37
+ }
38
+ }
39
+
40
+ function debugString(val) {
41
+ // primitive types
42
+ const type = typeof val;
43
+ if (type == 'number' || type == 'boolean' || val == null) {
44
+ return `${val}`;
45
+ }
46
+ if (type == 'string') {
47
+ return `"${val}"`;
48
+ }
49
+ if (type == 'symbol') {
50
+ const description = val.description;
51
+ if (description == null) {
52
+ return 'Symbol';
53
+ } else {
54
+ return `Symbol(${description})`;
55
+ }
56
+ }
57
+ if (type == 'function') {
58
+ const name = val.name;
59
+ if (typeof name == 'string' && name.length > 0) {
60
+ return `Function(${name})`;
61
+ } else {
62
+ return 'Function';
63
+ }
64
+ }
65
+ // objects
66
+ if (Array.isArray(val)) {
67
+ const length = val.length;
68
+ let debug = '[';
69
+ if (length > 0) {
70
+ debug += debugString(val[0]);
71
+ }
72
+ for(let i = 1; i < length; i++) {
73
+ debug += ', ' + debugString(val[i]);
74
+ }
75
+ debug += ']';
76
+ return debug;
77
+ }
78
+ // Test for built-in
79
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
80
+ let className;
81
+ if (builtInMatches && builtInMatches.length > 1) {
82
+ className = builtInMatches[1];
83
+ } else {
84
+ // Failed to match the standard '[object ClassName]'
85
+ return toString.call(val);
86
+ }
87
+ if (className == 'Object') {
88
+ // we're a user defined class or Object
89
+ // JSON.stringify avoids problems with cycles, and is generally much
90
+ // easier than looping through ownProperties of `val`.
91
+ try {
92
+ return 'Object(' + JSON.stringify(val) + ')';
93
+ } catch (_) {
94
+ return 'Object';
95
+ }
96
+ }
97
+ // errors
98
+ if (val instanceof Error) {
99
+ return `${val.name}: ${val.message}\n${val.stack}`;
100
+ }
101
+ // TODO we could test for more things here, like `Set`s and `Map`s.
102
+ return className;
103
+ }
104
+
105
+ let WASM_VECTOR_LEN = 0;
106
+
107
+ let cachedTextEncoder = new TextEncoder('utf-8');
108
+
109
+ const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
110
+ ? function (arg, view) {
111
+ return cachedTextEncoder.encodeInto(arg, view);
112
+ }
113
+ : function (arg, view) {
114
+ const buf = cachedTextEncoder.encode(arg);
115
+ view.set(buf);
116
+ return {
117
+ read: arg.length,
118
+ written: buf.length
119
+ };
120
+ });
121
+
122
+ function passStringToWasm0(arg, malloc, realloc) {
123
+
124
+ if (realloc === undefined) {
125
+ const buf = cachedTextEncoder.encode(arg);
126
+ const ptr = malloc(buf.length, 1) >>> 0;
127
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
128
+ WASM_VECTOR_LEN = buf.length;
129
+ return ptr;
130
+ }
131
+
132
+ let len = arg.length;
133
+ let ptr = malloc(len, 1) >>> 0;
134
+
135
+ const mem = getUint8ArrayMemory0();
136
+
137
+ let offset = 0;
138
+
139
+ for (; offset < len; offset++) {
140
+ const code = arg.charCodeAt(offset);
141
+ if (code > 0x7F) break;
142
+ mem[ptr + offset] = code;
143
+ }
144
+
145
+ if (offset !== len) {
146
+ if (offset !== 0) {
147
+ arg = arg.slice(offset);
148
+ }
149
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
150
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
151
+ const ret = encodeString(arg, view);
152
+
153
+ offset += ret.written;
154
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
155
+ }
156
+
157
+ WASM_VECTOR_LEN = offset;
158
+ return ptr;
159
+ }
160
+
161
+ let cachedDataViewMemory0 = null;
162
+
163
+ function getDataViewMemory0() {
164
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
165
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
166
+ }
167
+ return cachedDataViewMemory0;
168
+ }
169
+
170
+ function isLikeNone(x) {
171
+ return x === undefined || x === null;
172
+ }
173
+
174
+ function takeFromExternrefTable0(idx) {
175
+ const value = wasm.__wbindgen_export_2.get(idx);
176
+ wasm.__externref_table_dealloc(idx);
177
+ return value;
178
+ }
179
+ /**
180
+ * @param {string} text
181
+ * @returns {string}
182
+ */
183
+ module.exports.escape = function(text) {
184
+ let deferred2_0;
185
+ let deferred2_1;
186
+ try {
187
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
188
+ const len0 = WASM_VECTOR_LEN;
189
+ const ret = wasm.escape(ptr0, len0);
190
+ deferred2_0 = ret[0];
191
+ deferred2_1 = ret[1];
192
+ return getStringFromWasm0(ret[0], ret[1]);
193
+ } finally {
194
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
195
+ }
196
+ };
197
+
198
+ const RRegexFinalization = (typeof FinalizationRegistry === 'undefined')
199
+ ? { register: () => {}, unregister: () => {} }
200
+ : new FinalizationRegistry(ptr => wasm.__wbg_rregex_free(ptr >>> 0, 1));
201
+ /**
202
+ * A compiled regular expression for matching Unicode strings.
203
+ * @see https://docs.rs/regex/latest/regex/
204
+ */
205
+ class RRegex {
206
+
207
+ __destroy_into_raw() {
208
+ const ptr = this.__wbg_ptr;
209
+ this.__wbg_ptr = 0;
210
+ RRegexFinalization.unregister(this);
211
+ return ptr;
212
+ }
213
+
214
+ free() {
215
+ const ptr = this.__destroy_into_raw();
216
+ wasm.__wbg_rregex_free(ptr, 0);
217
+ }
218
+ /**
219
+ * Returns the same as is_match, but starts the search at the given offset.
220
+ * The significance of the starting point is that it takes the surrounding context into consideration. For example, the `\A` anchor can only match when `start == 0`.
221
+ * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.is_match_at
222
+ * @param {string} text
223
+ * @param {number} start
224
+ * @returns {boolean}
225
+ */
226
+ isMatchAt(text, start) {
227
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
228
+ const len0 = WASM_VECTOR_LEN;
229
+ const ret = wasm.rregex_isMatchAt(this.__wbg_ptr, ptr0, len0, start);
230
+ return ret !== 0;
231
+ }
232
+ /**
233
+ * Replaces all non-overlapping matches in `text` with the replacement provided. This is the same as calling `replacen` with `limit` set to `0`.
234
+ * See the documentation for `replace` for details on how to access capturing group matches in the replacement string.
235
+ * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.replace_all
236
+ * @param {string} text
237
+ * @param {string} rep
238
+ * @returns {string}
239
+ */
240
+ replaceAll(text, rep) {
241
+ let deferred3_0;
242
+ let deferred3_1;
243
+ try {
244
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
245
+ const len0 = WASM_VECTOR_LEN;
246
+ const ptr1 = passStringToWasm0(rep, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
247
+ const len1 = WASM_VECTOR_LEN;
248
+ const ret = wasm.rregex_replaceAll(this.__wbg_ptr, ptr0, len0, ptr1, len1);
249
+ deferred3_0 = ret[0];
250
+ deferred3_1 = ret[1];
251
+ return getStringFromWasm0(ret[0], ret[1]);
252
+ } finally {
253
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
254
+ }
255
+ }
256
+ /**
257
+ * Returns the end location of a match in the text given.
258
+ * This method may have the same performance characteristics as `is_match`, except it provides an end location for a match. In particular, the location returned may be shorter than the proper end of the leftmost-first match.
259
+ * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.shortest_match
260
+ * @param {string} text
261
+ * @returns {number | undefined}
262
+ */
263
+ shortestMatch(text) {
264
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
265
+ const len0 = WASM_VECTOR_LEN;
266
+ const ret = wasm.rregex_shortestMatch(this.__wbg_ptr, ptr0, len0);
267
+ return ret === 0x100000001 ? undefined : ret;
268
+ }
269
+ /**
270
+ * Returns the same as shortest_match, but starts the search at the given offset.
271
+ * The significance of the starting point is that it takes the surrounding context into consideration. For example, the \A anchor can only match when `start == 0`.
272
+ * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.shortest_match_at
273
+ * @param {string} text
274
+ * @param {number} limit
275
+ * @returns {number | undefined}
276
+ */
277
+ shortestMatchAt(text, limit) {
278
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
279
+ const len0 = WASM_VECTOR_LEN;
280
+ const ret = wasm.rregex_shortestMatchAt(this.__wbg_ptr, ptr0, len0, limit);
281
+ return ret === 0x100000001 ? undefined : ret;
282
+ }
283
+ /**
284
+ * Compiles a regular expression. Once compiled, it can be used repeatedly to search, split or replace text in a string.
285
+ * If an invalid expression is given, then an error is returned.
286
+ * @param {string} re
287
+ */
288
+ constructor(re) {
289
+ const ptr0 = passStringToWasm0(re, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
290
+ const len0 = WASM_VECTOR_LEN;
291
+ const ret = wasm.rregex_new(ptr0, len0);
292
+ if (ret[2]) {
293
+ throw takeFromExternrefTable0(ret[1]);
294
+ }
295
+ this.__wbg_ptr = ret[0] >>> 0;
296
+ RRegexFinalization.register(this, this.__wbg_ptr, this);
297
+ return this;
298
+ }
299
+ /**
300
+ * Returns the start and end byte range of the leftmost-first match in `text`. If no match exists, then `undefined` is returned.
301
+ * Note that this should only be used if you want to discover the position of the match. Testing the existence of a match is faster if you use `is_match`.
302
+ * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.find
303
+ * @param {string} text
304
+ * @returns {any}
305
+ */
306
+ find(text) {
307
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
308
+ const len0 = WASM_VECTOR_LEN;
309
+ const ret = wasm.rregex_find(this.__wbg_ptr, ptr0, len0);
310
+ return ret;
311
+ }
312
+ /**
313
+ * Returns an iterator of substrings of `text` delimited by a match of the regular expression. Namely, each element of the iterator corresponds to text that isn’t matched by the regular expression.
314
+ * This method will not copy the text given.
315
+ * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.split
316
+ * @param {string} text
317
+ * @returns {any}
318
+ */
319
+ split(text) {
320
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
321
+ const len0 = WASM_VECTOR_LEN;
322
+ const ret = wasm.rregex_split(this.__wbg_ptr, ptr0, len0);
323
+ return ret;
324
+ }
325
+ /**
326
+ * Returns an iterator of at most `limit` substrings of `text` delimited by a match of the regular expression. (A limit of 0 will return no substrings.) Namely, each element of the iterator corresponds to text that isn’t matched by the regular expression. The remainder of the string that is not split will be the last element in the iterator.
327
+ * This method will not copy the text given.
328
+ * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.splitn
329
+ * @param {string} text
330
+ * @param {number} limit
331
+ * @returns {any}
332
+ */
333
+ splitn(text, limit) {
334
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
335
+ const len0 = WASM_VECTOR_LEN;
336
+ const ret = wasm.rregex_splitn(this.__wbg_ptr, ptr0, len0, limit);
337
+ return ret;
338
+ }
339
+ /**
340
+ * Return the Regex syntax object
341
+ * @returns {any}
342
+ */
343
+ syntax() {
344
+ const ret = wasm.rregex_syntax(this.__wbg_ptr);
345
+ return ret;
346
+ }
347
+ /**
348
+ * Returns the same as find, but starts the search at the given offset.
349
+ * The significance of the starting point is that it takes the surrounding context into consideration. For example, the \A anchor can only match when `start == 0`.
350
+ * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.find_at
351
+ * @param {string} text
352
+ * @param {number} start
353
+ * @returns {any}
354
+ */
355
+ findAt(text, start) {
356
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
357
+ const len0 = WASM_VECTOR_LEN;
358
+ const ret = wasm.rregex_findAt(this.__wbg_ptr, ptr0, len0, start);
359
+ return ret;
360
+ }
361
+ /**
362
+ * Replaces the leftmost-first match with the replacement provided.
363
+ * The replacement can be a regular string (where `$N` and `$name` are expanded to match capture groups) or a function that takes the matches’ `Captures` and returns the replaced string.
364
+ * If no match is found, then a copy of the string is returned unchanged.
365
+ * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.replace
366
+ * @param {string} text
367
+ * @param {string} rep
368
+ * @returns {string}
369
+ */
370
+ replace(text, rep) {
371
+ let deferred3_0;
372
+ let deferred3_1;
373
+ try {
374
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
375
+ const len0 = WASM_VECTOR_LEN;
376
+ const ptr1 = passStringToWasm0(rep, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
377
+ const len1 = WASM_VECTOR_LEN;
378
+ const ret = wasm.rregex_replace(this.__wbg_ptr, ptr0, len0, ptr1, len1);
379
+ deferred3_0 = ret[0];
380
+ deferred3_1 = ret[1];
381
+ return getStringFromWasm0(ret[0], ret[1]);
382
+ } finally {
383
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
384
+ }
385
+ }
386
+ /**
387
+ * Returns an array for each successive non-overlapping match in text, returning the start and end byte indices with respect to text.
388
+ * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.find_iter
389
+ * @param {string} text
390
+ * @returns {any}
391
+ */
392
+ findAll(text) {
393
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
394
+ const len0 = WASM_VECTOR_LEN;
395
+ const ret = wasm.rregex_findAll(this.__wbg_ptr, ptr0, len0);
396
+ return ret;
397
+ }
398
+ /**
399
+ * Returns true if and only if there is a match for the regex in the string given.
400
+ * It is recommended to use this method if all you need to do is test a match, since the underlying matching engine may be able to do less work.
401
+ * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.is_match
402
+ * @param {string} text
403
+ * @returns {boolean}
404
+ */
405
+ isMatch(text) {
406
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
407
+ const len0 = WASM_VECTOR_LEN;
408
+ const ret = wasm.rregex_isMatch(this.__wbg_ptr, ptr0, len0);
409
+ return ret !== 0;
410
+ }
411
+ /**
412
+ * Replaces at most `limit` non-overlapping matches in `text` with the replacement provided. If `limit` is 0, then all non-overlapping matches are replaced.
413
+ * See the documentation for `replace` for details on how to access capturing group matches in the replacement string.
414
+ * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.replacen
415
+ * @param {string} text
416
+ * @param {number} limit
417
+ * @param {string} rep
418
+ * @returns {string}
419
+ */
420
+ replacen(text, limit, rep) {
421
+ let deferred3_0;
422
+ let deferred3_1;
423
+ try {
424
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
425
+ const len0 = WASM_VECTOR_LEN;
426
+ const ptr1 = passStringToWasm0(rep, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
427
+ const len1 = WASM_VECTOR_LEN;
428
+ const ret = wasm.rregex_replacen(this.__wbg_ptr, ptr0, len0, limit, ptr1, len1);
429
+ deferred3_0 = ret[0];
430
+ deferred3_1 = ret[1];
431
+ return getStringFromWasm0(ret[0], ret[1]);
432
+ } finally {
433
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
434
+ }
435
+ }
436
+ /**
437
+ * Returns a string representing the regular expression
438
+ * @returns {string}
439
+ */
440
+ toString() {
441
+ let deferred1_0;
442
+ let deferred1_1;
443
+ try {
444
+ const ret = wasm.rregex_toString(this.__wbg_ptr);
445
+ deferred1_0 = ret[0];
446
+ deferred1_1 = ret[1];
447
+ return getStringFromWasm0(ret[0], ret[1]);
448
+ } finally {
449
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
450
+ }
451
+ }
452
+ }
453
+ module.exports.RRegex = RRegex;
454
+
455
+ const RRegexSetFinalization = (typeof FinalizationRegistry === 'undefined')
456
+ ? { register: () => {}, unregister: () => {} }
457
+ : new FinalizationRegistry(ptr => wasm.__wbg_rregexset_free(ptr >>> 0, 1));
458
+ /**
459
+ * Match multiple (possibly overlapping) regular expressions in a single scan.
460
+ * A regex set corresponds to the union of two or more regular expressions. That is, a regex set will match text where at least one of its constituent regular expressions matches. A regex set as its formulated here provides a touch more power: it will also report which regular expressions in the set match. Indeed, this is the key difference between regex sets and a single `Regex` with many alternates, since only one alternate can match at a time.
461
+ * @see https://docs.rs/regex/latest/regex/struct.RegexSet.html#method.empty
462
+ */
463
+ class RRegexSet {
464
+
465
+ __destroy_into_raw() {
466
+ const ptr = this.__wbg_ptr;
467
+ this.__wbg_ptr = 0;
468
+ RRegexSetFinalization.unregister(this);
469
+ return ptr;
470
+ }
471
+
472
+ free() {
473
+ const ptr = this.__destroy_into_raw();
474
+ wasm.__wbg_rregexset_free(ptr, 0);
475
+ }
476
+ /**
477
+ * Create a new regex set with the given regular expressions.
478
+ * @param {Array<any>} list
479
+ */
480
+ constructor(list) {
481
+ const ret = wasm.rregexset_new(list);
482
+ if (ret[2]) {
483
+ throw takeFromExternrefTable0(ret[1]);
484
+ }
485
+ this.__wbg_ptr = ret[0] >>> 0;
486
+ RRegexSetFinalization.register(this, this.__wbg_ptr, this);
487
+ return this;
488
+ }
489
+ /**
490
+ * Returns the set of regular expressions that match in the given text.
491
+ * The set returned contains the index of each regular expression that matches in the given text. The index is in correspondence with the order of regular expressions given to RegexSet’s constructor.
492
+ * the set can also be used to iterate over the matched indices.
493
+ * @param {string} text
494
+ * @returns {any}
495
+ */
496
+ matches(text) {
497
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
498
+ const len0 = WASM_VECTOR_LEN;
499
+ const ret = wasm.rregexset_matches(this.__wbg_ptr, ptr0, len0);
500
+ return ret;
501
+ }
502
+ /**
503
+ * Returns true if and only if one of the regexes in this set matches the text given.
504
+ * This method should be preferred if you only need to test whether any of the regexes in the set should match, but don’t care about which regexes matched. This is because the underlying matching engine will quit immediately after seeing the first match instead of continuing to find all matches.
505
+ * @see https://docs.rs/regex/latest/regex/struct.RegexSet.html#method.is_match
506
+ * @param {string} text
507
+ * @returns {boolean}
508
+ */
509
+ isMatch(text) {
510
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
511
+ const len0 = WASM_VECTOR_LEN;
512
+ const ret = wasm.rregexset_isMatch(this.__wbg_ptr, ptr0, len0);
513
+ return ret !== 0;
514
+ }
515
+ }
516
+ module.exports.RRegexSet = RRegexSet;
517
+
518
+ module.exports.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
519
+ const ret = arg0[arg1 >>> 0];
520
+ return ret;
521
+ };
522
+
523
+ module.exports.__wbg_length_e2d2a49132c1b256 = function(arg0) {
524
+ const ret = arg0.length;
525
+ return ret;
526
+ };
527
+
528
+ module.exports.__wbg_new_405e22f390576ce2 = function() {
529
+ const ret = new Object();
530
+ return ret;
531
+ };
532
+
533
+ module.exports.__wbg_new_78feb108b6472713 = function() {
534
+ const ret = new Array();
535
+ return ret;
536
+ };
537
+
538
+ module.exports.__wbg_new_c68d7209be747379 = function(arg0, arg1) {
539
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
540
+ return ret;
541
+ };
542
+
543
+ module.exports.__wbg_push_737cfc8c1432c2c6 = function(arg0, arg1) {
544
+ const ret = arg0.push(arg1);
545
+ return ret;
546
+ };
547
+
548
+ module.exports.__wbg_set_bb8cecf6a62b9f46 = function() { return handleError(function (arg0, arg1, arg2) {
549
+ const ret = Reflect.set(arg0, arg1, arg2);
550
+ return ret;
551
+ }, arguments) };
552
+
553
+ module.exports.__wbindgen_debug_string = function(arg0, arg1) {
554
+ const ret = debugString(arg1);
555
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
556
+ const len1 = WASM_VECTOR_LEN;
557
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
558
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
559
+ };
560
+
561
+ module.exports.__wbindgen_init_externref_table = function() {
562
+ const table = wasm.__wbindgen_export_2;
563
+ const offset = table.grow(4);
564
+ table.set(0, undefined);
565
+ table.set(offset + 0, undefined);
566
+ table.set(offset + 1, null);
567
+ table.set(offset + 2, true);
568
+ table.set(offset + 3, false);
569
+ ;
570
+ };
571
+
572
+ module.exports.__wbindgen_is_string = function(arg0) {
573
+ const ret = typeof(arg0) === 'string';
574
+ return ret;
575
+ };
576
+
577
+ module.exports.__wbindgen_number_new = function(arg0) {
578
+ const ret = arg0;
579
+ return ret;
580
+ };
581
+
582
+ module.exports.__wbindgen_string_get = function(arg0, arg1) {
583
+ const obj = arg1;
584
+ const ret = typeof(obj) === 'string' ? obj : undefined;
585
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
586
+ var len1 = WASM_VECTOR_LEN;
587
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
588
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
589
+ };
590
+
591
+ module.exports.__wbindgen_string_new = function(arg0, arg1) {
592
+ const ret = getStringFromWasm0(arg0, arg1);
593
+ return ret;
594
+ };
595
+
596
+ module.exports.__wbindgen_throw = function(arg0, arg1) {
597
+ throw new Error(getStringFromWasm0(arg0, arg1));
598
+ };
599
+
600
+ const path = require('path').join(__dirname, 'rregex.wasm');
601
+ const bytes = require('fs').readFileSync(path);
602
+
603
+ const wasmModule = new WebAssembly.Module(bytes);
604
+ const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
605
+ wasm = wasmInstance.exports;
606
+ module.exports.__wasm = wasm;
607
+
608
+ wasm.__wbindgen_start();
609
+