rregex 1.10.10 → 1.10.12
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/README.md +41 -2
- package/lib/cf.d.ts +2 -2
- package/lib/cf.mjs +2 -2
- package/lib/commonjs.cjs +27 -27
- package/lib/commonjs.d.ts +2 -2
- package/lib/esm.mjs +27 -27
- package/lib/rregex.wasm +0 -0
- package/lib/standalone.d.ts +2 -2
- package/lib/standalone.js +25 -25
- package/lib/types.d.ts +2 -2
- package/lib/web.d.ts +2 -2
- package/lib/web.js +27 -27
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -5,8 +5,6 @@ A dependency-free WebAssembly build of [Rust Regex](https://docs.rs/regex/latest
|
|
|
5
5
|
  
|
|
6
6
|
[](https://jsr.io/@rregex/rregex)
|
|
7
7
|
|
|
8
|
-
> Note: this project is not intended to be used in production jet
|
|
9
|
-
|
|
10
8
|
- [Why Rust Regex](#why-rust-regex)
|
|
11
9
|
- [Install](#install)
|
|
12
10
|
- [Supported Runtimes](#supported-runtimes)
|
|
@@ -16,6 +14,7 @@ A dependency-free WebAssembly build of [Rust Regex](https://docs.rs/regex/latest
|
|
|
16
14
|
- [`Match`](https://tsdocs.dev/docs/rregex/latest/types/Match.html)
|
|
17
15
|
- [`Captures`](https://tsdocs.dev/docs/rregex/latest/types/Captures.html)
|
|
18
16
|
- [`escape`](https://tsdocs.dev/docs/rregex/latest/functions/escape.html)
|
|
17
|
+
- [Benchmarks](#benchmarks)
|
|
19
18
|
- [Known Issues](#known-issues)
|
|
20
19
|
|
|
21
20
|
## Why Rust Regex
|
|
@@ -57,6 +56,46 @@ This package includes builds for multiple runtimes
|
|
|
57
56
|
| Browser | TODO | |
|
|
58
57
|
| Standalone | TODO | |
|
|
59
58
|
|
|
59
|
+
## Benchmarks
|
|
60
|
+
|
|
61
|
+
In general terms `rregex` is at least 1 order of magnitud slower than the native `RegExp` object, but still have a good performance. **Unless you required some of the features that `rregex` provides, you should always consider using the native `RegExp` object**
|
|
62
|
+
|
|
63
|
+
> Benchmarks are executed using [test/deno.bench.mjs](./test/deno.bench.mjs), and [test/node.bench.mjs](./test/node.bench.mjs)
|
|
64
|
+
|
|
65
|
+
### Email
|
|
66
|
+
|
|
67
|
+
| benchmark | time (avg) | iter/s |
|
|
68
|
+
| --------- | -------------: | ------: |
|
|
69
|
+
| RegExp | 342.91 µs/iter | 2,916.2 |
|
|
70
|
+
| RRegex | 7.27 ms/iter | 137.6 |
|
|
71
|
+
|
|
72
|
+
> summary: `RegExp` is 21.19x faster than `RRegex`
|
|
73
|
+
|
|
74
|
+
### IP
|
|
75
|
+
|
|
76
|
+
| benchmark | time (avg) | iter/s |
|
|
77
|
+
| --------- | ------------: | -------: |
|
|
78
|
+
| RegExp | 72.63 µs/iter | 13,767.7 |
|
|
79
|
+
| RRegex | 7.02 ms/iter | 142.5 |
|
|
80
|
+
|
|
81
|
+
> summary: `RegExp` is 96.59x faster than `RRegex`
|
|
82
|
+
|
|
83
|
+
### URI
|
|
84
|
+
|
|
85
|
+
| benchmark | time (avg) | iter/s |
|
|
86
|
+
| --------- | -------------: | ----------: |
|
|
87
|
+
| RegExp | 688.79 ns/iter | 1,451,825.0 |
|
|
88
|
+
| RRegex | 22.52 ms/iter | 44.4 |
|
|
89
|
+
|
|
90
|
+
> summary: `RegExp` is 32689.42x faster than `RRegex`
|
|
91
|
+
|
|
92
|
+
| benckmarks | benckmarks |
|
|
93
|
+
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
94
|
+
| [](https://jsbenchmark.com/#eyJjYXNlcyI6W3siaWQiOiJlZl9VbGJvYThpRGNYeGM3VUl4YnMiLCJjb2RlIjoiREFUQS5tYXRjaCgnKD86KD86MjVbMC01XXwyWzAtNF1bMC05XXxbMDFdP1swLTldWzAtOV0pXFxcXC4pezN9KD86MjVbMC01XXwyWzAtNF1bMC05XXxbMDFdP1swLTldWzAtOV0pJykiLCJkZXBlbmRlbmNpZXMiOltdLCJuYW1lIjoiUmVnRXhwOiBJUCJ9LHsiaWQiOiI0QkxuZmtPd0p4ZTZhQ0NSVmpIOVUiLCJjb2RlIjoibmV3IHJyZWdleC5SUmVnZXgoXCIoPzooPzoyNVswLTVdfDJbMC00XVswLTldfFswMV0_WzAtOV1bMC05XSlcXFxcLil7M30oPzoyNVswLTVdfDJbMC00XVswLTldfFswMV0_WzAtOV1bMC05XSlcIikuZmluZChEQVRBKSIsImRlcGVuZGVuY2llcyI6W10sIm5hbWUiOiJSUmVnZXg6IElQIn1dLCJjb25maWciOnsibmFtZSI6IlJSZWdleCB2cyBOYXRpdmU6IElQIiwicGFyYWxsZWwiOnRydWUsImdsb2JhbFRlc3RDb25maWciOnsiZGVwZW5kZW5jaWVzIjpbeyJ1cmwiOiJodHRwczovL2Nkbi5qc2RlbGl2ci5uZXQvbnBtL3JyZWdleEAxLjEwLjEwL2xpYi93ZWIubWluLmpzIiwibmFtZSI6InJyZWdleCIsImVzbSI6dHJ1ZX1dfSwiZGF0YUNvZGUiOiJjb25zdCB3cmVzID0gYXdhaXQgZmV0Y2goJ2h0dHBzOi8vY2RuL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order to compare with native regex these benchmarks follow the [`mariomka/regex-benchmark`](https://github.com/mariomka/regex-benchmark) structure
|
|
98
|
+
|
|
60
99
|
## Known Issues
|
|
61
100
|
|
|
62
101
|
If you call `splitn(text, limit)` and the expected result length is equal to `limit - 1` the result will include an extra item `""`, this behavior does not happen if `limit` es greater. **`fixed at >=1.3`**
|
package/lib/cf.d.ts
CHANGED
package/lib/cf.mjs
CHANGED
package/lib/commonjs.cjs
CHANGED
|
@@ -3,24 +3,6 @@ imports['wbg'] = module.exports;
|
|
|
3
3
|
let wasm;
|
|
4
4
|
const { TextDecoder, TextEncoder } = require(`util`);
|
|
5
5
|
|
|
6
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
7
|
-
|
|
8
|
-
cachedTextDecoder.decode();
|
|
9
|
-
|
|
10
|
-
let cachedUint8Memory0 = null;
|
|
11
|
-
|
|
12
|
-
function getUint8Memory0() {
|
|
13
|
-
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
14
|
-
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
15
|
-
}
|
|
16
|
-
return cachedUint8Memory0;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function getStringFromWasm0(ptr, len) {
|
|
20
|
-
ptr = ptr >>> 0;
|
|
21
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
22
|
-
}
|
|
23
|
-
|
|
24
6
|
const heap = new Array(128).fill(undefined);
|
|
25
7
|
|
|
26
8
|
heap.push(undefined, null, true, false);
|
|
@@ -50,6 +32,24 @@ function takeObject(idx) {
|
|
|
50
32
|
return ret;
|
|
51
33
|
}
|
|
52
34
|
|
|
35
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
36
|
+
|
|
37
|
+
cachedTextDecoder.decode();
|
|
38
|
+
|
|
39
|
+
let cachedUint8Memory0 = null;
|
|
40
|
+
|
|
41
|
+
function getUint8Memory0() {
|
|
42
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
43
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
44
|
+
}
|
|
45
|
+
return cachedUint8Memory0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function getStringFromWasm0(ptr, len) {
|
|
49
|
+
ptr = ptr >>> 0;
|
|
50
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
53
|
let WASM_VECTOR_LEN = 0;
|
|
54
54
|
|
|
55
55
|
let cachedTextEncoder = new TextEncoder('utf-8');
|
|
@@ -1098,11 +1098,6 @@ class RRegexSet {
|
|
|
1098
1098
|
}
|
|
1099
1099
|
module.exports.RRegexSet = RRegexSet;
|
|
1100
1100
|
|
|
1101
|
-
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
1102
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
1103
|
-
return addHeapObject(ret);
|
|
1104
|
-
};
|
|
1105
|
-
|
|
1106
1101
|
module.exports.__wbindgen_number_new = function(arg0) {
|
|
1107
1102
|
const ret = arg0;
|
|
1108
1103
|
return addHeapObject(ret);
|
|
@@ -1112,6 +1107,11 @@ module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
|
1112
1107
|
takeObject(arg0);
|
|
1113
1108
|
};
|
|
1114
1109
|
|
|
1110
|
+
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
1111
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1112
|
+
return addHeapObject(ret);
|
|
1113
|
+
};
|
|
1114
|
+
|
|
1115
1115
|
module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
1116
1116
|
const obj = getObject(arg1);
|
|
1117
1117
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
@@ -1131,15 +1131,15 @@ module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
|
|
|
1131
1131
|
return addHeapObject(ret);
|
|
1132
1132
|
};
|
|
1133
1133
|
|
|
1134
|
+
module.exports.__wbg_set_f975102236d3c502 = function(arg0, arg1, arg2) {
|
|
1135
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
1136
|
+
};
|
|
1137
|
+
|
|
1134
1138
|
module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
1135
1139
|
const ret = getObject(arg0);
|
|
1136
1140
|
return addHeapObject(ret);
|
|
1137
1141
|
};
|
|
1138
1142
|
|
|
1139
|
-
module.exports.__wbg_set_f975102236d3c502 = function(arg0, arg1, arg2) {
|
|
1140
|
-
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
1141
|
-
};
|
|
1142
|
-
|
|
1143
1143
|
module.exports.__wbg_get_bd8e338fbd5f5cc8 = function(arg0, arg1) {
|
|
1144
1144
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
1145
1145
|
return addHeapObject(ret);
|
package/lib/commonjs.d.ts
CHANGED
package/lib/esm.mjs
CHANGED
|
@@ -1,24 +1,6 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
5
|
-
|
|
6
|
-
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
7
|
-
|
|
8
|
-
let cachedUint8Memory0 = null;
|
|
9
|
-
|
|
10
|
-
function getUint8Memory0() {
|
|
11
|
-
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
12
|
-
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
13
|
-
}
|
|
14
|
-
return cachedUint8Memory0;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function getStringFromWasm0(ptr, len) {
|
|
18
|
-
ptr = ptr >>> 0;
|
|
19
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
4
|
const heap = new Array(128).fill(undefined);
|
|
23
5
|
|
|
24
6
|
heap.push(undefined, null, true, false);
|
|
@@ -48,6 +30,24 @@ function takeObject(idx) {
|
|
|
48
30
|
return ret;
|
|
49
31
|
}
|
|
50
32
|
|
|
33
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
34
|
+
|
|
35
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
36
|
+
|
|
37
|
+
let cachedUint8Memory0 = null;
|
|
38
|
+
|
|
39
|
+
function getUint8Memory0() {
|
|
40
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
41
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
42
|
+
}
|
|
43
|
+
return cachedUint8Memory0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function getStringFromWasm0(ptr, len) {
|
|
47
|
+
ptr = ptr >>> 0;
|
|
48
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
51
|
let WASM_VECTOR_LEN = 0;
|
|
52
52
|
|
|
53
53
|
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
@@ -1087,10 +1087,6 @@ export class RRegexSet {
|
|
|
1087
1087
|
|
|
1088
1088
|
const imports = {
|
|
1089
1089
|
wbg: {
|
|
1090
|
-
__wbindgen_string_new: function(arg0, arg1) {
|
|
1091
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
1092
|
-
return addHeapObject(ret);
|
|
1093
|
-
},
|
|
1094
1090
|
__wbindgen_number_new: function(arg0) {
|
|
1095
1091
|
const ret = arg0;
|
|
1096
1092
|
return addHeapObject(ret);
|
|
@@ -1098,6 +1094,10 @@ const imports = {
|
|
|
1098
1094
|
__wbindgen_object_drop_ref: function(arg0) {
|
|
1099
1095
|
takeObject(arg0);
|
|
1100
1096
|
},
|
|
1097
|
+
__wbindgen_string_new: function(arg0, arg1) {
|
|
1098
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1099
|
+
return addHeapObject(ret);
|
|
1100
|
+
},
|
|
1101
1101
|
__wbindgen_string_get: function(arg0, arg1) {
|
|
1102
1102
|
const obj = getObject(arg1);
|
|
1103
1103
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
@@ -1114,13 +1114,13 @@ const imports = {
|
|
|
1114
1114
|
const ret = BigInt.asUintN(64, arg0);
|
|
1115
1115
|
return addHeapObject(ret);
|
|
1116
1116
|
},
|
|
1117
|
+
__wbg_set_f975102236d3c502: function(arg0, arg1, arg2) {
|
|
1118
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
1119
|
+
},
|
|
1117
1120
|
__wbindgen_object_clone_ref: function(arg0) {
|
|
1118
1121
|
const ret = getObject(arg0);
|
|
1119
1122
|
return addHeapObject(ret);
|
|
1120
1123
|
},
|
|
1121
|
-
__wbg_set_f975102236d3c502: function(arg0, arg1, arg2) {
|
|
1122
|
-
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
1123
|
-
},
|
|
1124
1124
|
__wbg_get_bd8e338fbd5f5cc8: function(arg0, arg1) {
|
|
1125
1125
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
1126
1126
|
return addHeapObject(ret);
|
|
@@ -1206,6 +1206,6 @@ export const metadata = {
|
|
|
1206
1206
|
],
|
|
1207
1207
|
"homepage": "http://rregex.dev",
|
|
1208
1208
|
"repository": "https://github.com/2fd/rregex",
|
|
1209
|
-
"regex": "1.10.
|
|
1210
|
-
"regex-syntax": "0.8.
|
|
1209
|
+
"regex": "1.10.5",
|
|
1210
|
+
"regex-syntax": "0.8.4"
|
|
1211
1211
|
}
|
package/lib/rregex.wasm
CHANGED
|
Binary file
|
package/lib/standalone.d.ts
CHANGED
package/lib/standalone.js
CHANGED
|
@@ -7,24 +7,6 @@ let wasm_bindgen;
|
|
|
7
7
|
}
|
|
8
8
|
let wasm = undefined;
|
|
9
9
|
|
|
10
|
-
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
11
|
-
|
|
12
|
-
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
13
|
-
|
|
14
|
-
let cachedUint8Memory0 = null;
|
|
15
|
-
|
|
16
|
-
function getUint8Memory0() {
|
|
17
|
-
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
18
|
-
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
19
|
-
}
|
|
20
|
-
return cachedUint8Memory0;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function getStringFromWasm0(ptr, len) {
|
|
24
|
-
ptr = ptr >>> 0;
|
|
25
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
26
|
-
}
|
|
27
|
-
|
|
28
10
|
const heap = new Array(128).fill(undefined);
|
|
29
11
|
|
|
30
12
|
heap.push(undefined, null, true, false);
|
|
@@ -54,6 +36,24 @@ function takeObject(idx) {
|
|
|
54
36
|
return ret;
|
|
55
37
|
}
|
|
56
38
|
|
|
39
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
40
|
+
|
|
41
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
42
|
+
|
|
43
|
+
let cachedUint8Memory0 = null;
|
|
44
|
+
|
|
45
|
+
function getUint8Memory0() {
|
|
46
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
47
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
48
|
+
}
|
|
49
|
+
return cachedUint8Memory0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function getStringFromWasm0(ptr, len) {
|
|
53
|
+
ptr = ptr >>> 0;
|
|
54
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
57
|
let WASM_VECTOR_LEN = 0;
|
|
58
58
|
|
|
59
59
|
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
@@ -1136,10 +1136,6 @@ async function __wbg_load(module, imports) {
|
|
|
1136
1136
|
function __wbg_get_imports() {
|
|
1137
1137
|
const imports = {};
|
|
1138
1138
|
imports.wbg = {};
|
|
1139
|
-
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
1140
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
1141
|
-
return addHeapObject(ret);
|
|
1142
|
-
};
|
|
1143
1139
|
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
1144
1140
|
const ret = arg0;
|
|
1145
1141
|
return addHeapObject(ret);
|
|
@@ -1147,6 +1143,10 @@ function __wbg_get_imports() {
|
|
|
1147
1143
|
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
1148
1144
|
takeObject(arg0);
|
|
1149
1145
|
};
|
|
1146
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
1147
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1148
|
+
return addHeapObject(ret);
|
|
1149
|
+
};
|
|
1150
1150
|
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
1151
1151
|
const obj = getObject(arg1);
|
|
1152
1152
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
@@ -1163,13 +1163,13 @@ function __wbg_get_imports() {
|
|
|
1163
1163
|
const ret = BigInt.asUintN(64, arg0);
|
|
1164
1164
|
return addHeapObject(ret);
|
|
1165
1165
|
};
|
|
1166
|
+
imports.wbg.__wbg_set_f975102236d3c502 = function(arg0, arg1, arg2) {
|
|
1167
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
1168
|
+
};
|
|
1166
1169
|
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
1167
1170
|
const ret = getObject(arg0);
|
|
1168
1171
|
return addHeapObject(ret);
|
|
1169
1172
|
};
|
|
1170
|
-
imports.wbg.__wbg_set_f975102236d3c502 = function(arg0, arg1, arg2) {
|
|
1171
|
-
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
1172
|
-
};
|
|
1173
1173
|
imports.wbg.__wbg_get_bd8e338fbd5f5cc8 = function(arg0, arg1) {
|
|
1174
1174
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
1175
1175
|
return addHeapObject(ret);
|
package/lib/types.d.ts
CHANGED
package/lib/web.d.ts
CHANGED
package/lib/web.js
CHANGED
|
@@ -1,23 +1,5 @@
|
|
|
1
1
|
let wasm;
|
|
2
2
|
|
|
3
|
-
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
4
|
-
|
|
5
|
-
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
6
|
-
|
|
7
|
-
let cachedUint8Memory0 = null;
|
|
8
|
-
|
|
9
|
-
function getUint8Memory0() {
|
|
10
|
-
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
11
|
-
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
12
|
-
}
|
|
13
|
-
return cachedUint8Memory0;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function getStringFromWasm0(ptr, len) {
|
|
17
|
-
ptr = ptr >>> 0;
|
|
18
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
19
|
-
}
|
|
20
|
-
|
|
21
3
|
const heap = new Array(128).fill(undefined);
|
|
22
4
|
|
|
23
5
|
heap.push(undefined, null, true, false);
|
|
@@ -47,6 +29,24 @@ function takeObject(idx) {
|
|
|
47
29
|
return ret;
|
|
48
30
|
}
|
|
49
31
|
|
|
32
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
33
|
+
|
|
34
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
35
|
+
|
|
36
|
+
let cachedUint8Memory0 = null;
|
|
37
|
+
|
|
38
|
+
function getUint8Memory0() {
|
|
39
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
40
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
41
|
+
}
|
|
42
|
+
return cachedUint8Memory0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function getStringFromWasm0(ptr, len) {
|
|
46
|
+
ptr = ptr >>> 0;
|
|
47
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
50
|
let WASM_VECTOR_LEN = 0;
|
|
51
51
|
|
|
52
52
|
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
@@ -1127,10 +1127,6 @@ async function __wbg_load(module, imports) {
|
|
|
1127
1127
|
function __wbg_get_imports() {
|
|
1128
1128
|
const imports = {};
|
|
1129
1129
|
imports.wbg = {};
|
|
1130
|
-
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
1131
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
1132
|
-
return addHeapObject(ret);
|
|
1133
|
-
};
|
|
1134
1130
|
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
1135
1131
|
const ret = arg0;
|
|
1136
1132
|
return addHeapObject(ret);
|
|
@@ -1138,6 +1134,10 @@ function __wbg_get_imports() {
|
|
|
1138
1134
|
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
1139
1135
|
takeObject(arg0);
|
|
1140
1136
|
};
|
|
1137
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
1138
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1139
|
+
return addHeapObject(ret);
|
|
1140
|
+
};
|
|
1141
1141
|
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
1142
1142
|
const obj = getObject(arg1);
|
|
1143
1143
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
@@ -1154,13 +1154,13 @@ function __wbg_get_imports() {
|
|
|
1154
1154
|
const ret = BigInt.asUintN(64, arg0);
|
|
1155
1155
|
return addHeapObject(ret);
|
|
1156
1156
|
};
|
|
1157
|
+
imports.wbg.__wbg_set_f975102236d3c502 = function(arg0, arg1, arg2) {
|
|
1158
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
1159
|
+
};
|
|
1157
1160
|
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
1158
1161
|
const ret = getObject(arg0);
|
|
1159
1162
|
return addHeapObject(ret);
|
|
1160
1163
|
};
|
|
1161
|
-
imports.wbg.__wbg_set_f975102236d3c502 = function(arg0, arg1, arg2) {
|
|
1162
|
-
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
1163
|
-
};
|
|
1164
1164
|
imports.wbg.__wbg_get_bd8e338fbd5f5cc8 = function(arg0, arg1) {
|
|
1165
1165
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
1166
1166
|
return addHeapObject(ret);
|
|
@@ -1281,6 +1281,6 @@ export const metadata = {
|
|
|
1281
1281
|
],
|
|
1282
1282
|
"homepage": "http://rregex.dev",
|
|
1283
1283
|
"repository": "https://github.com/2fd/rregex",
|
|
1284
|
-
"regex": "1.10.
|
|
1285
|
-
"regex-syntax": "0.8.
|
|
1284
|
+
"regex": "1.10.5",
|
|
1285
|
+
"regex-syntax": "0.8.4"
|
|
1286
1286
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rregex",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.12",
|
|
4
4
|
"description": "A dependency-free WebAssembly build of Rust Regex for Javascript",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"@semantic-release/exec": "^6.0.3",
|
|
16
16
|
"concurrently": "^8.2.2",
|
|
17
17
|
"semantic-release": "^23.0.6",
|
|
18
|
+
"tinybench": "^2.7.0",
|
|
18
19
|
"toml": "^3.0.0"
|
|
19
20
|
},
|
|
20
21
|
"scripts": {
|