re2js 1.2.3 → 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.
- package/README.md +34 -0
- package/build/index.cjs.cjs +438 -191
- package/build/index.cjs.cjs.map +1 -1
- package/build/index.esm.d.ts +28 -8
- package/build/index.esm.d.ts.map +1 -1
- package/build/index.esm.js +438 -191
- package/build/index.esm.js.map +1 -1
- package/build/index.umd.js +438 -191
- package/build/index.umd.js.map +1 -1
- package/package.json +12 -12
package/build/index.esm.d.ts
CHANGED
|
@@ -56,19 +56,19 @@ export class Matcher {
|
|
|
56
56
|
*/
|
|
57
57
|
reset(): Matcher;
|
|
58
58
|
/** @type {number} */
|
|
59
|
-
matcherInputLength: number;
|
|
59
|
+
matcherInputLength: number | undefined;
|
|
60
60
|
/** @type {number} */
|
|
61
|
-
appendPos: number;
|
|
62
|
-
hasMatch: boolean;
|
|
63
|
-
hasGroups: boolean;
|
|
64
|
-
anchorFlag: number;
|
|
61
|
+
appendPos: number | undefined;
|
|
62
|
+
hasMatch: boolean | undefined;
|
|
63
|
+
hasGroups: boolean | undefined;
|
|
64
|
+
anchorFlag: number | undefined;
|
|
65
65
|
/**
|
|
66
66
|
* Resets the {@code Matcher} and changes the input.
|
|
67
67
|
* @param {Utf8MatcherInput|Utf16MatcherInput} input
|
|
68
68
|
* @returns {Matcher} the {@code Matcher} itself, for chained method calls
|
|
69
69
|
*/
|
|
70
70
|
resetMatcherInput(input: Utf8MatcherInput | Utf16MatcherInput): Matcher;
|
|
71
|
-
matcherInput: Utf8MatcherInput | Utf16MatcherInput;
|
|
71
|
+
matcherInput: Utf8MatcherInput | Utf16MatcherInput | undefined;
|
|
72
72
|
/**
|
|
73
73
|
* Returns the start of the named group of the most recent match, or -1 if the group was not
|
|
74
74
|
* matched.
|
|
@@ -340,6 +340,26 @@ export class RE2JS {
|
|
|
340
340
|
* @returns {Matcher}
|
|
341
341
|
*/
|
|
342
342
|
matcher(input: string | number[]): Matcher;
|
|
343
|
+
/**
|
|
344
|
+
* Tests whether the regular expression matches any part of the input string.
|
|
345
|
+
* Performance Note: This method is highly optimized. Because it only returns
|
|
346
|
+
* a boolean and does not extract capture groups, it bypasses the `Matcher` overhead
|
|
347
|
+
* and guarantees execution on the high-speed DFA engine whenever possible.
|
|
348
|
+
*
|
|
349
|
+
* @param {string|number[]} input - The input string or UTF-8 byte array to test against.
|
|
350
|
+
* @returns {boolean} `true` if the pattern is found anywhere in the input, `false` otherwise.
|
|
351
|
+
*/
|
|
352
|
+
test(input: string | number[]): boolean;
|
|
353
|
+
/**
|
|
354
|
+
* Tests whether the regular expression matches the ENTIRE input string.
|
|
355
|
+
* * **Performance Note:** This operates identically to `.matches()`, but is significantly
|
|
356
|
+
* faster because it does not request capture group data. By requesting 0 capture groups,
|
|
357
|
+
* it securely routes execution through the DFA fast-path.
|
|
358
|
+
*
|
|
359
|
+
* @param {string|number[]} input - The input string or UTF-8 byte array to test against.
|
|
360
|
+
* @returns {boolean} `true` if the exact input string fully matches the pattern, `false` otherwise.
|
|
361
|
+
*/
|
|
362
|
+
testExact(input: string | number[]): boolean;
|
|
343
363
|
/**
|
|
344
364
|
* Splits input around instances of the regular expression. It returns an array giving the strings
|
|
345
365
|
* that occur before, between, and after instances of the regular expression.
|
|
@@ -434,7 +454,7 @@ export class RE2JSSyntaxException extends RE2JSException {
|
|
|
434
454
|
getPattern(): string | null;
|
|
435
455
|
}
|
|
436
456
|
declare class Utf8MatcherInput extends MatcherInputBase {
|
|
437
|
-
constructor(bytes?:
|
|
457
|
+
constructor(bytes?: null);
|
|
438
458
|
bytes: any;
|
|
439
459
|
getEncoding(): any;
|
|
440
460
|
/**
|
|
@@ -454,7 +474,7 @@ declare class Utf8MatcherInput extends MatcherInputBase {
|
|
|
454
474
|
length(): number;
|
|
455
475
|
}
|
|
456
476
|
declare class Utf16MatcherInput extends MatcherInputBase {
|
|
457
|
-
constructor(charSequence?:
|
|
477
|
+
constructor(charSequence?: null);
|
|
458
478
|
charSequence: any;
|
|
459
479
|
getEncoding(): any;
|
|
460
480
|
/**
|
package/build/index.esm.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.d.ts","sourceRoot":"","sources":["index.esm.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm.d.ts","sourceRoot":"","sources":["index.esm.js"],"names":[],"mappings":"AA0kCA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH;IACE;;;;;;OAMG;IACH,6BAHW,MAAM,GACJ,MAAM,CAalB;IACD;;;;OAIG;IACH,qBAHW,KAAK,SACL,gBAAgB,GAAC,iBAAiB,GAAC,MAAM,EAAE,GAAC,MAAM,EA0B5D;IAnBC,oBAA2B;IAG3B,qBAAqB;IACrB,mBADW,MAAM,CACqC;IAEtD,uBAAuB;IACvB,QADW,MAAM,EAAE,CACH;IAChB,qCAAqC;IACrC,aADW,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CACC;IAClC,qBAAqB;IACrB,sBADW,MAAM,CACqC;IAUxD;;;OAGG;IACH,WAFa,KAAK,CAIjB;IAED;;;;OAIG;IACH,SAFa,OAAO,CAiBnB;IAbC,qBAAqB;IACrB,uCAAoD;IAEpD,qBAAqB;IACrB,8BAAkB;IAElB,8BAAqB;IAGrB,+BAAsB;IAEtB,+BAAmB;IAIrB;;;;OAIG;IACH,yBAHW,gBAAgB,GAAC,iBAAiB,GAChC,OAAO,CASnB;IAHC,+DAAyB;IAK3B;;;;;OAKG;IACH,cAHW,MAAM,GAAC,MAAM,GACX,MAAM,CAYlB;IAED;;;;;OAKG;IACH,YAHW,MAAM,GAAC,MAAM,GACX,MAAM,CAYlB;IAED;;;;;;;;;OASG;IACH,eAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,cAHW,MAAM,GAAC,MAAM,GACV,MAAM,OAAA,CAgBnB;IACD;;;;OAIG;IACH,cAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,kBAqBC;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