rregex 1.13.1 → 1.13.3

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 CHANGED
@@ -58,43 +58,69 @@ This package includes builds for multiple runtimes
58
58
 
59
59
  ## Benchmarks
60
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 | 254.8 µs/iter | 3,925.0 |
70
- | RRegex | 1.7 ms/iter | 589.9 |
71
-
72
- > summary: `RegExp` is 6.65x faster than `RRegex`
73
-
74
- ### IP
75
-
76
- | benchmark | time (avg) | iter/s |
77
- | --------- | ------------: | --------: |
78
- | RegExp | 39.1 µs/iter | 25,600.0 |
79
- | RRegex | 1.4 ms/iter | 698.1 |
80
-
81
- > summary: `RegExp` is 36.67x faster than `RRegex`
82
-
83
- ### URI
84
-
85
- | benchmark | time (avg) | iter/s |
86
- | --------- | -------------: | ----------: |
87
- | RegExp | 422.7 ns/iter | 2,366,000.0 |
88
- | RRegex | 1.5 ms/iter | 652.6 |
89
-
90
- > summary: `RegExp` is 3625x faster than `RRegex`
91
-
92
- | benckmarks | benckmarks |
93
- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
94
- | [![Simple IP](./img/rregex-vs-native_-simple-ip.png)](https://jsbenchmark.com/#eyJjYXNlcyI6W3siaWQiOiJlZl9VbGJvYThpRGNYeGM3VUl4YnMiLCJjb2RlIjoiREFUQS5tYXRjaCgnKD86KD86MjVbMC01XXwyWzAtNF1bMC05XXxbMDFdP1swLTldWzAtOV0pXFxcXC4pezN9KD86MjVbMC01XXwyWzAtNF1bMC05XXxbMDFdP1swLTldWzAtOV0pJykiLCJkZXBlbmRlbmNpZXMiOltdLCJuYW1lIjoiUmVnRXhwOiBJUCJ9LHsiaWQiOiI0QkxuZmtPd0p4ZTZhQ0NSVmpIOVUiLCJjb2RlIjoibmV3IHJyZWdleC5SUmVnZXgoXCIoPzooPzoyNVswLTVdfDJbMC00XVswLTldfFswMV0_WzAtOV1bMC05XSlcXFxcLil7M30oPzoyNVswLTVdfDJbMC00XVswLTldfFswMV0_WzAtOV1bMC05XSlcIikuZmluZChEQVRBKSIsImRlcGVuZGVuY2llcyI6W10sIm5hbWUiOiJSUmVnZXg6IElQIn1dLCJjb25maWciOnsibmFtZSI6IlJSZWdleCB2cyBOYXRpdmU6IElQIiwicGFyYWxsZWwiOnRydWUsImdsb2JhbFRlc3RDb25maWciOnsiZGVwZW5kZW5jaWVzIjpbeyJ1cmwiOiJodHRwczovL2Nkbi5qc2RlbGl2ci5uZXQvbnBtL3JyZWdleEAxLjEwLjEwL2xpYi93ZWIubWluLmpzIiwibmFtZSI6InJyZWdleCIsImVzbSI6dHJ1ZX1dfSwiZGF0YUNvZGUiOiJjb25zdCB3cmVzID0gYXdha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F0YS5zbGljZSgwLCBNYXRoLmZsb29yKGRhdGEubGVuZ3RoLzUpKSJ9fQ) |
96
-
97
- > **Note:** In order to compare with native regex these benchmarks follow the [`mariomka/regex-benchmark`](https://github.com/mariomka/regex-benchmark) structure
61
+ **TL;DR:** use the native `RegExp` unless you need a feature of `rregex`. `rregex` wins only when it has to scan the whole input and the pattern makes `RegExp` backtrack.
62
+
63
+ ### Results
64
+
65
+ Each case compiles the pattern once, before the benchmark, and runs one call on the same 619K-char input (10% of [`test/__data__/input-text.txt`](./test/__data__/input-text.txt), from [`mariomka/regex-benchmark`](https://github.com/mariomka/regex-benchmark)). Lower time is better. The ratio is `RRegex` time ÷ `RegExp` time: below 1× means `rregex` is faster.
66
+
67
+ | pattern | operation | `RegExp` Node | `RRegex` Node | ratio | `RegExp` Chrome | `RRegex` Chrome | ratio |
68
+ | ------- | ------------ | ------------: | ------------: | --------: | --------------: | --------------: | --------: |
69
+ | email | `new` | — | 521 µs | — | — | — | — |
70
+ | email | `isMatch` | 238 µs | 513 µs | 2.2× | 238 µs | 748 µs | 3.1× |
71
+ | email | `find` | 239 µs | 509 µs | 2.1× | 236 µs | 676 µs | 2.9× |
72
+ | email | `findAll` | 4.41 ms | 558 µs | **0.13×** | 4.52 ms | 715 µs | **0.16×** |
73
+ | email | `replaceAll` | 4.39 ms | 801 µs | **0.18×** | 4.47 ms | 1.06 ms | **0.24×** |
74
+ | ip | `new` | — | 92 µs | — | — | — | — |
75
+ | ip | `isMatch` | 35.6 µs | 747 µs | 21× | 35.4 µs | 921 µs | 26× |
76
+ | ip | `find` | 35.8 µs | 752 µs | 21× | 35.5 µs | 919 µs | 26× |
77
+ | ip | `findAll` | 35.0 µs | 759 µs | 22× | 35.1 µs | 913 µs | 26× |
78
+ | ip | `replaceAll` | 34.8 µs | 968 µs | 28× | 35.4 µs | 1.33 ms | 38× |
79
+ | uri | `new` | — | 257 µs | — | — | — | — |
80
+ | uri | `isMatch` | 400 ns | 513 µs | 1,284× | 330 ns | 703 µs | 2,132× |
81
+ | uri | `find` | 398 ns | 517 µs | 1,301× | 394 ns | 704 µs | 1,786× |
82
+ | uri | `findAll` | 3.61 ms | 788 µs | **0.22×** | 3.56 ms | 963 µs | **0.27×** |
83
+ | uri | `replaceAll` | 3.50 ms | 884 µs | **0.25×** | 3.60 ms | 1.24 ms | **0.34×** |
84
+ | set | `new` | — | 654 µs | — | — | — | — |
85
+ | set | `matches` | 276 µs | 1.93 ms | 7.0× | 280 µs | 2.09 ms | 7.5× |
86
+
87
+ > Node v24.19.0 and Chrome 150 on an Apple M4 Pro, `regex` 1.13.1. The `RegExp` equivalent of `findAll` is `Array.from(text.matchAll(re))`, of `replaceAll` is `text.replaceAll(re, '-')`, and of `set: matches` is one `test()` call for each pattern. `RegExp` has no `new` case: it compiles the pattern on first use.
88
+
89
+ <picture>
90
+ <source media="(prefers-color-scheme: dark)" srcset="./img/rregex-vs-native-email-dark.svg" />
91
+ <img alt="RRegex vs RegExp: email, in Chrome" src="./img/rregex-vs-native-email-light.svg" />
92
+ </picture>
93
+ <picture>
94
+ <source media="(prefers-color-scheme: dark)" srcset="./img/rregex-vs-native-uri-dark.svg" />
95
+ <img alt="RRegex vs RegExp: URI, in Chrome" src="./img/rregex-vs-native-uri-light.svg" />
96
+ </picture>
97
+ <picture>
98
+ <source media="(prefers-color-scheme: dark)" srcset="./img/rregex-vs-native-ip-dark.svg" />
99
+ <img alt="RRegex vs RegExp: IP, in Chrome" src="./img/rregex-vs-native-ip-light.svg" />
100
+ </picture>
101
+ <picture>
102
+ <source media="(prefers-color-scheme: dark)" srcset="./img/rregex-vs-native-set-dark.svg" />
103
+ <img alt="RRegexSet vs RegExp: set, in Chrome" src="./img/rregex-vs-native-set-light.svg" />
104
+ </picture>
105
+
106
+ ### Conclusions
107
+
108
+ - **Each call has a cost before matching starts.** `rregex` copies the input from a JavaScript string (UTF-16) into the WebAssembly memory as UTF-8. On this input that copy takes about 0.5 ms on Node and 0.7 ms on Chrome. `new RRegex('^x').isMatch(text)` takes the same time as the other `isMatch` cases. The cost grows with the input length. On a 1K-char input, an `isMatch` call takes about 2 µs.
109
+ - **`RegExp` wins when the call can stop early.** `isMatch` and `find` stop at the first match. The first URI is at char 55, so `RegExp` returns in less than 1 µs and `rregex` is more than 1,000× slower. The difference is smaller when the first match is far from the start (email: 2–3×). The input contains no IP address, but `RegExp` rejects each position quickly and scans all of the input in 35 µs, less than a tenth of the time of the copy into WebAssembly.
110
+ - **`rregex` wins on full scans with backtracking patterns.** `findAll` and `replaceAll` must read all of the input. With the email and URI patterns, `RegExp` tries a match at almost every position and takes 3.5–4.5 ms. The Rust engine finishes in linear time, so `rregex` is 3–8× faster, even with the copy cost.
111
+ - **`RRegexSet` does not make a set of patterns faster.** On this input, `matches` is about 7× slower than one `test()` call for each pattern. Use it when you need the matches of many patterns in a single pass, not for speed.
112
+ - **Compile once.** `new RRegex` takes 0.1–0.5 ms and `new RRegexSet` 0.65 ms, about the same as one call. Keep the instance and use it again, and call `free()` when you do not need it.
113
+ - **Node and Chrome show the same pattern.** Chrome is up to 50% slower on the `rregex` cases. The `RegExp` times are almost the same in the two runtimes.
114
+
115
+ The time of `rregex` is predictable: the time to copy the input plus a time that is linear in the input length. The Rust engine has no catastrophic backtracking, so you can also use it with patterns from users that you do not trust. The time of `RegExp` depends on the pattern and on the input. It can be much faster or much slower than `rregex`.
116
+
117
+ > [!NOTE]
118
+ > `\w` matches only ASCII chars in `RegExp`, and Unicode chars in `rregex`. The patterns give the same matches on this input.
119
+
120
+ ### Run the benchmarks
121
+
122
+ - **Browser:** run `pnpm build`, then `pnpm test:browser`, and open <http://localhost:8080/test/browser/bench.html>. The page shows the charts above and gives a Markdown table and SVG/PNG images of the results.
123
+ - **Node:** the same cases are in [`bin/bench-cases.mjs`](./bin/bench-cases.mjs). [`bin/bench-compare.mjs`](./bin/bench-compare.mjs) compares two builds of `rregex` with each other, and CI uses it on each pull request.
98
124
 
99
125
  ## Known Issues
100
126
 
package/lib/cf.d.ts CHANGED
@@ -1268,10 +1268,10 @@ export interface InitOutput {
1268
1268
  readonly rregex_syntax: (a: number) => [number, number, number];
1269
1269
  readonly rregex_toString: (a: number) => [number, number];
1270
1270
  readonly __wbg_rregexset_free: (a: number, b: number) => void;
1271
- readonly escape: (a: number, b: number) => [number, number];
1272
1271
  readonly rregexset_isMatch: (a: number, b: number, c: number) => number;
1273
1272
  readonly rregexset_matches: (a: number, b: number, c: number) => [number, number];
1274
1273
  readonly rregexset_new: (a: any) => [number, number, number];
1274
+ readonly escape: (a: number, b: number) => [number, number];
1275
1275
  readonly __wbindgen_exn_store: (a: number) => void;
1276
1276
  readonly __externref_table_alloc: () => number;
1277
1277
  readonly __wbindgen_export_2: WebAssembly.Table;
package/lib/commonjs.cjs CHANGED
@@ -946,16 +946,6 @@ module.exports.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
946
946
  return ret;
947
947
  };
948
948
 
949
- module.exports.__wbg_fromCodePoint_f37c25c172f2e8b5 = function() { return handleError(function (arg0) {
950
- const ret = String.fromCodePoint(arg0 >>> 0);
951
- return ret;
952
- }, arguments) };
953
-
954
- module.exports.__wbg_from_2a5d3e218e67aa85 = function(arg0) {
955
- const ret = Array.from(arg0);
956
- return ret;
957
- };
958
-
959
949
  module.exports.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
960
950
  const ret = arg0[arg1 >>> 0];
961
951
  return ret;
@@ -986,16 +976,17 @@ module.exports.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0
986
976
  return ret;
987
977
  };
988
978
 
989
- module.exports.__wbg_push_737cfc8c1432c2c6 = function(arg0, arg1) {
990
- const ret = arg0.push(arg1);
979
+ module.exports.__wbg_of_2eaf5a02d443ef03 = function(arg0) {
980
+ const ret = Array.of(arg0);
991
981
  return ret;
992
982
  };
993
983
 
994
- module.exports.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
995
- arg0[arg1 >>> 0] = arg2;
984
+ module.exports.__wbg_push_737cfc8c1432c2c6 = function(arg0, arg1) {
985
+ const ret = arg0.push(arg1);
986
+ return ret;
996
987
  };
997
988
 
998
- module.exports.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
989
+ module.exports.__wbg_set_3236fed40a9cf7a8 = function(arg0, arg1, arg2) {
999
990
  arg0[arg1] = arg2;
1000
991
  };
1001
992
 
@@ -1004,9 +995,16 @@ module.exports.__wbg_set_bb8cecf6a62b9f46 = function() { return handleError(func
1004
995
  return ret;
1005
996
  }, arguments) };
1006
997
 
1007
- module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
1008
- const ret = BigInt.asUintN(64, arg0);
1009
- return ret;
998
+ module.exports.__wbg_setbool_dad62f465efebe9f = function(arg0, arg1, arg2) {
999
+ arg0[arg1] = arg2 !== 0;
1000
+ };
1001
+
1002
+ module.exports.__wbg_setnum_a8317d001ce5988f = function(arg0, arg1, arg2) {
1003
+ arg0[arg1] = arg2;
1004
+ };
1005
+
1006
+ module.exports.__wbg_setstr_689ca87d17411175 = function(arg0, arg1, arg2, arg3) {
1007
+ arg0[arg1] = getStringFromWasm0(arg2, arg3);
1010
1008
  };
1011
1009
 
1012
1010
  module.exports.__wbindgen_error_new = function(arg0, arg1) {
package/lib/esm.mjs CHANGED
@@ -933,14 +933,6 @@ const imports = {
933
933
  const ret = arg0.buffer;
934
934
  return ret;
935
935
  },
936
- __wbg_fromCodePoint_f37c25c172f2e8b5: function() { return handleError(function (arg0) {
937
- const ret = String.fromCodePoint(arg0 >>> 0);
938
- return ret;
939
- }, arguments) },
940
- __wbg_from_2a5d3e218e67aa85: function(arg0) {
941
- const ret = Array.from(arg0);
942
- return ret;
943
- },
944
936
  __wbg_get_b9b93047fe3cf45b: function(arg0, arg1) {
945
937
  const ret = arg0[arg1 >>> 0];
946
938
  return ret;
@@ -965,23 +957,29 @@ const imports = {
965
957
  const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
966
958
  return ret;
967
959
  },
960
+ __wbg_of_2eaf5a02d443ef03: function(arg0) {
961
+ const ret = Array.of(arg0);
962
+ return ret;
963
+ },
968
964
  __wbg_push_737cfc8c1432c2c6: function(arg0, arg1) {
969
965
  const ret = arg0.push(arg1);
970
966
  return ret;
971
967
  },
972
- __wbg_set_37837023f3d740e8: function(arg0, arg1, arg2) {
973
- arg0[arg1 >>> 0] = arg2;
974
- },
975
- __wbg_set_3f1d0b984ed272ed: function(arg0, arg1, arg2) {
968
+ __wbg_set_3236fed40a9cf7a8: function(arg0, arg1, arg2) {
976
969
  arg0[arg1] = arg2;
977
970
  },
978
971
  __wbg_set_bb8cecf6a62b9f46: function() { return handleError(function (arg0, arg1, arg2) {
979
972
  const ret = Reflect.set(arg0, arg1, arg2);
980
973
  return ret;
981
974
  }, arguments) },
982
- __wbindgen_bigint_from_u64: function(arg0) {
983
- const ret = BigInt.asUintN(64, arg0);
984
- return ret;
975
+ __wbg_setbool_dad62f465efebe9f: function(arg0, arg1, arg2) {
976
+ arg0[arg1] = arg2 !== 0;
977
+ },
978
+ __wbg_setnum_a8317d001ce5988f: function(arg0, arg1, arg2) {
979
+ arg0[arg1] = arg2;
980
+ },
981
+ __wbg_setstr_689ca87d17411175: function(arg0, arg1, arg2, arg3) {
982
+ arg0[arg1] = getStringFromWasm0(arg2, arg3);
985
983
  },
986
984
  __wbindgen_error_new: function(arg0, arg1) {
987
985
  const ret = new Error(getStringFromWasm0(arg0, arg1));
package/lib/rregex.wasm CHANGED
Binary file
@@ -22,10 +22,10 @@ export const rregex_splitn: (a: number, b: number, c: number, d: number) => [num
22
22
  export const rregex_syntax: (a: number) => [number, number, number];
23
23
  export const rregex_toString: (a: number) => [number, number];
24
24
  export const __wbg_rregexset_free: (a: number, b: number) => void;
25
- export const escape: (a: number, b: number) => [number, number];
26
25
  export const rregexset_isMatch: (a: number, b: number, c: number) => number;
27
26
  export const rregexset_matches: (a: number, b: number, c: number) => [number, number];
28
27
  export const rregexset_new: (a: any) => [number, number, number];
28
+ export const escape: (a: number, b: number) => [number, number];
29
29
  export const __wbindgen_exn_store: (a: number) => void;
30
30
  export const __externref_table_alloc: () => number;
31
31
  export const __wbindgen_export_2: WebAssembly.Table;
@@ -1271,10 +1271,10 @@ declare interface InitOutput {
1271
1271
  readonly rregex_syntax: (a: number) => [number, number, number];
1272
1272
  readonly rregex_toString: (a: number) => [number, number];
1273
1273
  readonly __wbg_rregexset_free: (a: number, b: number) => void;
1274
- readonly escape: (a: number, b: number) => [number, number];
1275
1274
  readonly rregexset_isMatch: (a: number, b: number, c: number) => number;
1276
1275
  readonly rregexset_matches: (a: number, b: number, c: number) => [number, number];
1277
1276
  readonly rregexset_new: (a: any) => [number, number, number];
1277
+ readonly escape: (a: number, b: number) => [number, number];
1278
1278
  readonly __wbindgen_exn_store: (a: number) => void;
1279
1279
  readonly __externref_table_alloc: () => number;
1280
1280
  readonly __wbindgen_export_2: WebAssembly.Table;
package/lib/standalone.js CHANGED
@@ -982,14 +982,6 @@ let wasm_bindgen;
982
982
  const ret = arg0.buffer;
983
983
  return ret;
984
984
  };
985
- imports.wbg.__wbg_fromCodePoint_f37c25c172f2e8b5 = function() { return handleError(function (arg0) {
986
- const ret = String.fromCodePoint(arg0 >>> 0);
987
- return ret;
988
- }, arguments) };
989
- imports.wbg.__wbg_from_2a5d3e218e67aa85 = function(arg0) {
990
- const ret = Array.from(arg0);
991
- return ret;
992
- };
993
985
  imports.wbg.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
994
986
  const ret = arg0[arg1 >>> 0];
995
987
  return ret;
@@ -1014,23 +1006,29 @@ let wasm_bindgen;
1014
1006
  const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
1015
1007
  return ret;
1016
1008
  };
1009
+ imports.wbg.__wbg_of_2eaf5a02d443ef03 = function(arg0) {
1010
+ const ret = Array.of(arg0);
1011
+ return ret;
1012
+ };
1017
1013
  imports.wbg.__wbg_push_737cfc8c1432c2c6 = function(arg0, arg1) {
1018
1014
  const ret = arg0.push(arg1);
1019
1015
  return ret;
1020
1016
  };
1021
- imports.wbg.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
1022
- arg0[arg1 >>> 0] = arg2;
1023
- };
1024
- imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
1017
+ imports.wbg.__wbg_set_3236fed40a9cf7a8 = function(arg0, arg1, arg2) {
1025
1018
  arg0[arg1] = arg2;
1026
1019
  };
1027
1020
  imports.wbg.__wbg_set_bb8cecf6a62b9f46 = function() { return handleError(function (arg0, arg1, arg2) {
1028
1021
  const ret = Reflect.set(arg0, arg1, arg2);
1029
1022
  return ret;
1030
1023
  }, arguments) };
1031
- imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
1032
- const ret = BigInt.asUintN(64, arg0);
1033
- return ret;
1024
+ imports.wbg.__wbg_setbool_dad62f465efebe9f = function(arg0, arg1, arg2) {
1025
+ arg0[arg1] = arg2 !== 0;
1026
+ };
1027
+ imports.wbg.__wbg_setnum_a8317d001ce5988f = function(arg0, arg1, arg2) {
1028
+ arg0[arg1] = arg2;
1029
+ };
1030
+ imports.wbg.__wbg_setstr_689ca87d17411175 = function(arg0, arg1, arg2, arg3) {
1031
+ arg0[arg1] = getStringFromWasm0(arg2, arg3);
1034
1032
  };
1035
1033
  imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
1036
1034
  const ret = new Error(getStringFromWasm0(arg0, arg1));
package/lib/types.d.ts CHANGED
@@ -1268,10 +1268,10 @@ export interface InitOutput {
1268
1268
  readonly rregex_syntax: (a: number) => [number, number, number];
1269
1269
  readonly rregex_toString: (a: number) => [number, number];
1270
1270
  readonly __wbg_rregexset_free: (a: number, b: number) => void;
1271
- readonly escape: (a: number, b: number) => [number, number];
1272
1271
  readonly rregexset_isMatch: (a: number, b: number, c: number) => number;
1273
1272
  readonly rregexset_matches: (a: number, b: number, c: number) => [number, number];
1274
1273
  readonly rregexset_new: (a: any) => [number, number, number];
1274
+ readonly escape: (a: number, b: number) => [number, number];
1275
1275
  readonly __wbindgen_exn_store: (a: number) => void;
1276
1276
  readonly __externref_table_alloc: () => number;
1277
1277
  readonly __wbindgen_export_2: WebAssembly.Table;
package/lib/web.d.ts CHANGED
@@ -1268,10 +1268,10 @@ export interface InitOutput {
1268
1268
  readonly rregex_syntax: (a: number) => [number, number, number];
1269
1269
  readonly rregex_toString: (a: number) => [number, number];
1270
1270
  readonly __wbg_rregexset_free: (a: number, b: number) => void;
1271
- readonly escape: (a: number, b: number) => [number, number];
1272
1271
  readonly rregexset_isMatch: (a: number, b: number, c: number) => number;
1273
1272
  readonly rregexset_matches: (a: number, b: number, c: number) => [number, number];
1274
1273
  readonly rregexset_new: (a: any) => [number, number, number];
1274
+ readonly escape: (a: number, b: number) => [number, number];
1275
1275
  readonly __wbindgen_exn_store: (a: number) => void;
1276
1276
  readonly __externref_table_alloc: () => number;
1277
1277
  readonly __wbindgen_export_2: WebAssembly.Table;
package/lib/web.js CHANGED
@@ -973,14 +973,6 @@ function __wbg_get_imports() {
973
973
  const ret = arg0.buffer;
974
974
  return ret;
975
975
  };
976
- imports.wbg.__wbg_fromCodePoint_f37c25c172f2e8b5 = function() { return handleError(function (arg0) {
977
- const ret = String.fromCodePoint(arg0 >>> 0);
978
- return ret;
979
- }, arguments) };
980
- imports.wbg.__wbg_from_2a5d3e218e67aa85 = function(arg0) {
981
- const ret = Array.from(arg0);
982
- return ret;
983
- };
984
976
  imports.wbg.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
985
977
  const ret = arg0[arg1 >>> 0];
986
978
  return ret;
@@ -1005,23 +997,29 @@ function __wbg_get_imports() {
1005
997
  const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
1006
998
  return ret;
1007
999
  };
1000
+ imports.wbg.__wbg_of_2eaf5a02d443ef03 = function(arg0) {
1001
+ const ret = Array.of(arg0);
1002
+ return ret;
1003
+ };
1008
1004
  imports.wbg.__wbg_push_737cfc8c1432c2c6 = function(arg0, arg1) {
1009
1005
  const ret = arg0.push(arg1);
1010
1006
  return ret;
1011
1007
  };
1012
- imports.wbg.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
1013
- arg0[arg1 >>> 0] = arg2;
1014
- };
1015
- imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
1008
+ imports.wbg.__wbg_set_3236fed40a9cf7a8 = function(arg0, arg1, arg2) {
1016
1009
  arg0[arg1] = arg2;
1017
1010
  };
1018
1011
  imports.wbg.__wbg_set_bb8cecf6a62b9f46 = function() { return handleError(function (arg0, arg1, arg2) {
1019
1012
  const ret = Reflect.set(arg0, arg1, arg2);
1020
1013
  return ret;
1021
1014
  }, arguments) };
1022
- imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
1023
- const ret = BigInt.asUintN(64, arg0);
1024
- return ret;
1015
+ imports.wbg.__wbg_setbool_dad62f465efebe9f = function(arg0, arg1, arg2) {
1016
+ arg0[arg1] = arg2 !== 0;
1017
+ };
1018
+ imports.wbg.__wbg_setnum_a8317d001ce5988f = function(arg0, arg1, arg2) {
1019
+ arg0[arg1] = arg2;
1020
+ };
1021
+ imports.wbg.__wbg_setstr_689ca87d17411175 = function(arg0, arg1, arg2, arg3) {
1022
+ arg0[arg1] = getStringFromWasm0(arg2, arg3);
1025
1023
  };
1026
1024
  imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
1027
1025
  const ret = new Error(getStringFromWasm0(arg0, arg1));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rregex",
3
- "version": "1.13.1",
3
+ "version": "1.13.3",
4
4
  "description": "A dependency-free WebAssembly build of Rust Regex for Javascript",
5
5
  "private": false,
6
6
  "type": "module",
@@ -8,6 +8,9 @@
8
8
  "types": "./lib/commonjs.d.cts",
9
9
  "module": "./lib/esm.mjs",
10
10
  "browser": "./lib/web.js",
11
+ "files": [
12
+ "lib"
13
+ ],
11
14
  "exports": {
12
15
  "./package.json": "./package.json",
13
16
  ".": {
@@ -40,6 +43,7 @@
40
43
  "setup": "./bin/install.sh",
41
44
  "build": "./bin/build.sh",
42
45
  "test": "node --test test/node.test.mjs",
46
+ "test:browser": "node test/browser/serve.mjs",
43
47
  "test:rs": "wasm-pack test",
44
48
  "semantic-release": "semantic-release"
45
49
  },
@@ -100,6 +104,21 @@
100
104
  "range": "1.9.x",
101
105
  "channel": "1.9.x"
102
106
  },
107
+ {
108
+ "name": "1.10.x",
109
+ "range": "1.10.x",
110
+ "channel": "1.10.x"
111
+ },
112
+ {
113
+ "name": "1.11.x",
114
+ "range": "1.11.x",
115
+ "channel": "1.11.x"
116
+ },
117
+ {
118
+ "name": "1.12.x",
119
+ "range": "1.12.x",
120
+ "channel": "1.12.x"
121
+ },
103
122
  {
104
123
  "name": "master"
105
124
  }
package/jsr.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "name": "@rregex/rregex",
3
- "version": "0.0.0-development",
4
- "description": "A dependency-free WebAssembly build of Rust Regex for Javascript",
5
- "exports": "./lib/esm.mjs",
6
- "publish": {
7
- "include": [
8
- "LICENSE",
9
- "README.md",
10
- "jsr.json",
11
- "lib/rregex.wasm",
12
- "lib/rregex.wasm.d.ts",
13
- "lib/esm.mjs",
14
- "lib/esm.d.ts"
15
- ]
16
- }
17
- }