re2js 2.8.3 → 2.8.4

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/build/index.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
  * re2js
3
3
  * RE2JS is the JavaScript port of RE2, a regular expression engine that provides linear time matching
4
4
  *
5
- * @version v2.8.3
5
+ * @version v2.8.4
6
6
  * @author Oleksii Vasyliev
7
7
  * @homepage https://github.com/le0pard/re2js#readme
8
8
  * @repository github:le0pard/re2js
@@ -57,7 +57,7 @@ for (let i = 0; i < ASCII_SIZE; i++) {
57
57
  else ASCII_TO_LOWER[i] = i;
58
58
  }
59
59
  var Codepoint = class {
60
- static CODES = new Map([
60
+ static CODES = /* @__PURE__ */ new Map([
61
61
  ["\x07", 7],
62
62
  ["\b", 8],
63
63
  [" ", 9],
@@ -168,7 +168,7 @@ var UnicodeRangeTable = class {
168
168
  };
169
169
  //#endregion
170
170
  //#region src/UnicodeTables.js
171
- const B64_MAP = new Uint8Array(256);
171
+ const B64_MAP = /* @__PURE__ */ new Uint8Array(256);
172
172
  for (let i = 0, b = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-"; i < 64; i++) B64_MAP[b.charCodeAt(i)] = i;
173
173
  const decodeVLQ = (str) => {
174
174
  const res = [];
@@ -1251,6 +1251,8 @@ var Matcher = class Matcher {
1251
1251
  */
1252
1252
  resetMatcherInput(input) {
1253
1253
  if (input === null) throw new Error("input is null");
1254
+ if (!(input instanceof MatcherInputBase)) if (Utils.isByteArray(input)) input = MatcherInput.utf8(input);
1255
+ else input = MatcherInput.utf16(input);
1254
1256
  this.matcherInput = input;
1255
1257
  this.reset();
1256
1258
  return this;
@@ -2426,14 +2428,14 @@ const MAX_BACKTRACK_VECTOR = 256 * 1024;
2426
2428
  var BitState = class {
2427
2429
  constructor() {
2428
2430
  this.end = 0;
2429
- this.cap = new Int32Array(0);
2430
- this.matchcap = new Int32Array(0);
2431
+ this.cap = /* @__PURE__ */ new Int32Array(0);
2432
+ this.matchcap = /* @__PURE__ */ new Int32Array(0);
2431
2433
  this.ncap = 0;
2432
2434
  this.jobPc = new Int32Array(INITIAL_JOB_CAPACITY);
2433
2435
  this.jobArg = new Uint8Array(INITIAL_JOB_CAPACITY);
2434
2436
  this.jobPos = new Int32Array(INITIAL_JOB_CAPACITY);
2435
2437
  this.jobLen = 0;
2436
- this.visited = new Uint32Array(0);
2438
+ this.visited = /* @__PURE__ */ new Uint32Array(0);
2437
2439
  }
2438
2440
  reset(prog, end, ncap) {
2439
2441
  this.end = end;
@@ -3943,7 +3945,7 @@ const code3 = [
3943
3945
  97,
3944
3946
  122
3945
3947
  ];
3946
- const PERL_GROUPS = new Map([
3948
+ const PERL_GROUPS = /* @__PURE__ */ new Map([
3947
3949
  ["\\d", new CharGroup(1, code1)],
3948
3950
  ["\\D", new CharGroup(-1, code1)],
3949
3951
  ["\\s", new CharGroup(1, code2)],
@@ -4017,7 +4019,7 @@ const code17 = [
4017
4019
  97,
4018
4020
  102
4019
4021
  ];
4020
- const POSIX_GROUPS = new Map([
4022
+ const POSIX_GROUPS = /* @__PURE__ */ new Map([
4021
4023
  ["[:alnum:]", new CharGroup(1, code4)],
4022
4024
  ["[:^alnum:]", new CharGroup(-1, code4)],
4023
4025
  ["[:alpha:]", new CharGroup(1, code5)],
package/build/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * re2js
3
3
  * RE2JS is the JavaScript port of RE2, a regular expression engine that provides linear time matching
4
4
  *
5
- * @version v2.8.3
5
+ * @version v2.8.4
6
6
  * @author Oleksii Vasyliev
7
7
  * @homepage https://github.com/le0pard/re2js#readme
8
8
  * @repository github:le0pard/re2js
@@ -56,7 +56,7 @@ for (let i = 0; i < ASCII_SIZE; i++) {
56
56
  else ASCII_TO_LOWER[i] = i;
57
57
  }
58
58
  var Codepoint = class {
59
- static CODES = new Map([
59
+ static CODES = /* @__PURE__ */ new Map([
60
60
  ["\x07", 7],
61
61
  ["\b", 8],
62
62
  [" ", 9],
@@ -167,7 +167,7 @@ var UnicodeRangeTable = class {
167
167
  };
168
168
  //#endregion
169
169
  //#region src/UnicodeTables.js
170
- const B64_MAP = new Uint8Array(256);
170
+ const B64_MAP = /* @__PURE__ */ new Uint8Array(256);
171
171
  for (let i = 0, b = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-"; i < 64; i++) B64_MAP[b.charCodeAt(i)] = i;
172
172
  const decodeVLQ = (str) => {
173
173
  const res = [];
@@ -1250,6 +1250,8 @@ var Matcher = class Matcher {
1250
1250
  */
1251
1251
  resetMatcherInput(input) {
1252
1252
  if (input === null) throw new Error("input is null");
1253
+ if (!(input instanceof MatcherInputBase)) if (Utils.isByteArray(input)) input = MatcherInput.utf8(input);
1254
+ else input = MatcherInput.utf16(input);
1253
1255
  this.matcherInput = input;
1254
1256
  this.reset();
1255
1257
  return this;
@@ -2425,14 +2427,14 @@ const MAX_BACKTRACK_VECTOR = 256 * 1024;
2425
2427
  var BitState = class {
2426
2428
  constructor() {
2427
2429
  this.end = 0;
2428
- this.cap = new Int32Array(0);
2429
- this.matchcap = new Int32Array(0);
2430
+ this.cap = /* @__PURE__ */ new Int32Array(0);
2431
+ this.matchcap = /* @__PURE__ */ new Int32Array(0);
2430
2432
  this.ncap = 0;
2431
2433
  this.jobPc = new Int32Array(INITIAL_JOB_CAPACITY);
2432
2434
  this.jobArg = new Uint8Array(INITIAL_JOB_CAPACITY);
2433
2435
  this.jobPos = new Int32Array(INITIAL_JOB_CAPACITY);
2434
2436
  this.jobLen = 0;
2435
- this.visited = new Uint32Array(0);
2437
+ this.visited = /* @__PURE__ */ new Uint32Array(0);
2436
2438
  }
2437
2439
  reset(prog, end, ncap) {
2438
2440
  this.end = end;
@@ -3942,7 +3944,7 @@ const code3 = [
3942
3944
  97,
3943
3945
  122
3944
3946
  ];
3945
- const PERL_GROUPS = new Map([
3947
+ const PERL_GROUPS = /* @__PURE__ */ new Map([
3946
3948
  ["\\d", new CharGroup(1, code1)],
3947
3949
  ["\\D", new CharGroup(-1, code1)],
3948
3950
  ["\\s", new CharGroup(1, code2)],
@@ -4016,7 +4018,7 @@ const code17 = [
4016
4018
  97,
4017
4019
  102
4018
4020
  ];
4019
- const POSIX_GROUPS = new Map([
4021
+ const POSIX_GROUPS = /* @__PURE__ */ new Map([
4020
4022
  ["[:alnum:]", new CharGroup(1, code4)],
4021
4023
  ["[:^alnum:]", new CharGroup(-1, code4)],
4022
4024
  ["[:alpha:]", new CharGroup(1, code5)],
@@ -2,7 +2,7 @@
2
2
  * re2js
3
3
  * RE2JS is the JavaScript port of RE2, a regular expression engine that provides linear time matching
4
4
  *
5
- * @version v2.8.3
5
+ * @version v2.8.4
6
6
  * @author Oleksii Vasyliev
7
7
  * @homepage https://github.com/le0pard/re2js#readme
8
8
  * @repository github:le0pard/re2js
@@ -60,7 +60,7 @@
60
60
  else ASCII_TO_LOWER[i] = i;
61
61
  }
62
62
  var Codepoint = class {
63
- static CODES = new Map([
63
+ static CODES = /* @__PURE__ */ new Map([
64
64
  ["\x07", 7],
65
65
  ["\b", 8],
66
66
  [" ", 9],
@@ -171,7 +171,7 @@
171
171
  };
172
172
  //#endregion
173
173
  //#region src/UnicodeTables.js
174
- const B64_MAP = new Uint8Array(256);
174
+ const B64_MAP = /* @__PURE__ */ new Uint8Array(256);
175
175
  for (let i = 0, b = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-"; i < 64; i++) B64_MAP[b.charCodeAt(i)] = i;
176
176
  const decodeVLQ = (str) => {
177
177
  const res = [];
@@ -1254,6 +1254,8 @@
1254
1254
  */
1255
1255
  resetMatcherInput(input) {
1256
1256
  if (input === null) throw new Error("input is null");
1257
+ if (!(input instanceof MatcherInputBase)) if (Utils.isByteArray(input)) input = MatcherInput.utf8(input);
1258
+ else input = MatcherInput.utf16(input);
1257
1259
  this.matcherInput = input;
1258
1260
  this.reset();
1259
1261
  return this;
@@ -2429,14 +2431,14 @@
2429
2431
  var BitState = class {
2430
2432
  constructor() {
2431
2433
  this.end = 0;
2432
- this.cap = new Int32Array(0);
2433
- this.matchcap = new Int32Array(0);
2434
+ this.cap = /* @__PURE__ */ new Int32Array(0);
2435
+ this.matchcap = /* @__PURE__ */ new Int32Array(0);
2434
2436
  this.ncap = 0;
2435
2437
  this.jobPc = new Int32Array(INITIAL_JOB_CAPACITY);
2436
2438
  this.jobArg = new Uint8Array(INITIAL_JOB_CAPACITY);
2437
2439
  this.jobPos = new Int32Array(INITIAL_JOB_CAPACITY);
2438
2440
  this.jobLen = 0;
2439
- this.visited = new Uint32Array(0);
2441
+ this.visited = /* @__PURE__ */ new Uint32Array(0);
2440
2442
  }
2441
2443
  reset(prog, end, ncap) {
2442
2444
  this.end = end;
@@ -3946,7 +3948,7 @@
3946
3948
  97,
3947
3949
  122
3948
3950
  ];
3949
- const PERL_GROUPS = new Map([
3951
+ const PERL_GROUPS = /* @__PURE__ */ new Map([
3950
3952
  ["\\d", new CharGroup(1, code1)],
3951
3953
  ["\\D", new CharGroup(-1, code1)],
3952
3954
  ["\\s", new CharGroup(1, code2)],
@@ -4020,7 +4022,7 @@
4020
4022
  97,
4021
4023
  102
4022
4024
  ];
4023
- const POSIX_GROUPS = new Map([
4025
+ const POSIX_GROUPS = /* @__PURE__ */ new Map([
4024
4026
  ["[:alnum:]", new CharGroup(1, code4)],
4025
4027
  ["[:^alnum:]", new CharGroup(-1, code4)],
4026
4028
  ["[:alpha:]", new CharGroup(1, code5)],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "re2js",
3
- "version": "2.8.3",
3
+ "version": "2.8.4",
4
4
  "description": "RE2JS is the JavaScript port of RE2, a regular expression engine that provides linear time matching",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -56,24 +56,24 @@
56
56
  },
57
57
  "devDependencies": {
58
58
  "@eslint/js": "^9.39.4",
59
- "@unicode/unicode-17.0.0": "^1.6.16",
60
- "@vitest/browser": "^4.1.6",
61
- "@vitest/browser-playwright": "^4.1.6",
62
- "@vitest/coverage-v8": "^4.1.6",
59
+ "@unicode/unicode-17.0.0": "^1.6.17",
60
+ "@vitest/browser": "^4.1.9",
61
+ "@vitest/browser-playwright": "^4.1.9",
62
+ "@vitest/coverage-v8": "^4.1.9",
63
63
  "@yarnpkg/pnpify": "^4.1.6",
64
64
  "dts-bundle-generator": "^9.5.1",
65
65
  "eslint": "9.39.4",
66
66
  "eslint-config-prettier": "^10.1.8",
67
- "eslint-import-resolver-node": "^0.3.10",
67
+ "eslint-import-resolver-node": "^0.4.0",
68
68
  "eslint-plugin-import": "^2.32.0",
69
- "globals": "^17.6.0",
69
+ "globals": "^17.7.0",
70
70
  "lodash": "^4.18.1",
71
- "playwright": "^1.60.0",
72
- "prettier": "^3.8.3",
73
- "rolldown": "^1.0.1",
71
+ "playwright": "^1.61.1",
72
+ "prettier": "^3.8.4",
73
+ "rolldown": "^1.1.3",
74
74
  "typescript": "^6.0.3",
75
75
  "unicode-property-value-aliases": "^3.9.0",
76
- "vitest": "^4.1.6"
76
+ "vitest": "^4.1.9"
77
77
  },
78
- "packageManager": "yarn@4.14.1"
78
+ "packageManager": "yarn@4.17.0"
79
79
  }