re2js 1.2.0 → 1.2.2
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 +1 -1
- package/build/index.cjs.cjs +4 -6
- package/build/index.cjs.cjs.map +1 -1
- package/build/index.esm.d.ts +7 -7
- package/build/index.esm.d.ts.map +1 -1
- package/build/index.esm.js +4 -6
- package/build/index.esm.js.map +1 -1
- package/build/index.umd.js +4 -6
- package/build/index.umd.js.map +1 -1
- package/package.json +21 -19
package/build/index.esm.d.ts
CHANGED
|
@@ -251,7 +251,7 @@ declare class Matcher {
|
|
|
251
251
|
*/
|
|
252
252
|
reset(): Matcher;
|
|
253
253
|
matcherInputLength: any;
|
|
254
|
-
appendPos:
|
|
254
|
+
appendPos: number;
|
|
255
255
|
hasMatch: boolean;
|
|
256
256
|
hasGroups: boolean;
|
|
257
257
|
anchorFlag: number;
|
|
@@ -265,16 +265,16 @@ declare class Matcher {
|
|
|
265
265
|
* Returns the start of the named group of the most recent match, or -1 if the group was not
|
|
266
266
|
* matched.
|
|
267
267
|
* @param {string|number} [group=0]
|
|
268
|
-
* @returns {
|
|
268
|
+
* @returns {number}
|
|
269
269
|
*/
|
|
270
|
-
start(group?: string | number):
|
|
270
|
+
start(group?: string | number): number;
|
|
271
271
|
/**
|
|
272
272
|
* Returns the end of the named group of the most recent match, or -1 if the group was not
|
|
273
273
|
* matched.
|
|
274
274
|
* @param {string|number} [group=0]
|
|
275
|
-
* @returns {
|
|
275
|
+
* @returns {number}
|
|
276
276
|
*/
|
|
277
|
-
end(group?: string | number):
|
|
277
|
+
end(group?: string | number): number;
|
|
278
278
|
/**
|
|
279
279
|
* Returns the program size of this pattern.
|
|
280
280
|
*
|
|
@@ -289,9 +289,9 @@ declare class Matcher {
|
|
|
289
289
|
/**
|
|
290
290
|
* Returns the named group of the most recent match, or {@code null} if the group was not matched.
|
|
291
291
|
* @param {string|number} [group=0]
|
|
292
|
-
* @returns {string}
|
|
292
|
+
* @returns {?string}
|
|
293
293
|
*/
|
|
294
|
-
group(group?: string | number): string;
|
|
294
|
+
group(group?: string | number): string | null;
|
|
295
295
|
/**
|
|
296
296
|
* Returns the number of subgroups in this pattern.
|
|
297
297
|
*
|
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":"AAgyLA;;;;;;;;;GASG;AACH;IACE;;OAEG;IACH,gCAA4B;IAC5B;;OAEG;IACH,sBAAkB;IAClB;;;OAGG;IACH,yBAAqB;IACrB;;OAEG;IACH,sCAAkC;IAClC;;OAEG;IACH,6BAA0B;IAE1B;;;;;;;;;;OAUG;IACH,kBAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;;;;;;;;OAUG;IACH,6BAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;;;OAKG;IACH,sBAJW,MAAM,UACN,MAAM,GACJ,KAAK,CAwBjB;IAED;;;;;;;OAOG;IACH,sBALW,MAAM,SACN,MAAM,GAAC,MAAM,EAAE,GACb,OAAO,CAKnB;IAED;;;OAGG;IACH,wBAWC;IAED;;;;OAIG;IACH,qBAHW,MAAM,SACN,MAAM,EAOhB;IAHC,qBAA2B;IAE3B,mBAAuB;IAGzB;;;OAGG;IACH,cAEC;IAED;;;OAGG;IACH,SAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,WAFa,MAAM,CAIlB;IACD,WAEC;IAED;;;;;OAKG;IACH,eAHW,MAAM,GAAC,MAAM,EAAE,GACb,OAAO,CAInB;IAED;;;;;OAKG;IACH,eAHW,MAAM,GAAC,MAAM,EAAE,GACb,OAAO,CAOnB;IAED;;;;;;;;;;;;OAYG;IACH,aAJW,MAAM,UACN,MAAM,GACJ,MAAM,EAAE,CAgDpB;IAED;;;OAGG;IACH,YAFa,MAA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;IACH,aAFa,OAAO,CAInB;IAED;;;;;;;OAOG;IACH,aAJW,MAAM,GAAC,MAAM,GACX,OAAO,CAoBnB;IAED;;;;;;OAMG;IACH,iBAWC;IAED;;;;;OAKG;IACH,iBAJW,MAAM,OACN,MAAM,GACJ,MAAM,CAOlB;IAED;;;OAGG;IACH,eAFa,MAAM,CAIlB;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,0BAUC;IAED;;;;OAIG;IACH,kCA2DC;IAED;;;;OAIG;IACH,sCAiFC;IAED;;;;OAIG;IACH,cAFa,MAAM,CAIlB;IAED;;;;;;;;OAQG;IACH,wBALW,MAAM,aACN,OAAO,GACL,MAAM,CAKlB;IAED;;;;;;;;OAQG;IACH,0BALW,MAAM,aACN,OAAO,GACL,MAAM,CAKlB;IAED;;;;;;;OAOG;IACH,gBAWC;CACF;AA7rBD;IACE,yBAGC;IADC,WAAkB;IAEpB,mBAEC;IACD;;;OAGG;IACH,kBAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,WAFa,MAAM,EAAE,CAIpB;IAED;;;OAGG;IACH,UAFa,MAAM,CAIlB;CACF;AACD;IACE,gCAGC;IADC,kBAAgC;IAElC,mBAEC;IAED;;;OAGG;IACH,kBAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,WAFa,MAAM,EAAE,CAIpB;IAED;;;OAGG;IACH,UAFa,MAAM,CAIlB;CACF;AAzFD;;GAEG;AACH;IACE,8BAAkD;IAClD,oBAEC;IAED;;;OAGG;IACH,kBAFa,OAAO,CAInB;IAED;;;OAGG;IACH,mBAFa,OAAO,CAInB;CACF"}
|
package/build/index.esm.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 v1.2.
|
|
5
|
+
* @version v1.2.2
|
|
6
6
|
* @author Alexey Vasiliev
|
|
7
7
|
* @homepage https://github.com/le0pard/re2js#readme
|
|
8
8
|
* @repository github:le0pard/re2js
|
|
@@ -1023,7 +1023,7 @@ class Matcher {
|
|
|
1023
1023
|
* Returns the start of the named group of the most recent match, or -1 if the group was not
|
|
1024
1024
|
* matched.
|
|
1025
1025
|
* @param {string|number} [group=0]
|
|
1026
|
-
* @returns {
|
|
1026
|
+
* @returns {number}
|
|
1027
1027
|
*/
|
|
1028
1028
|
start(group = 0) {
|
|
1029
1029
|
if (typeof group === 'string') {
|
|
@@ -1041,7 +1041,7 @@ class Matcher {
|
|
|
1041
1041
|
* Returns the end of the named group of the most recent match, or -1 if the group was not
|
|
1042
1042
|
* matched.
|
|
1043
1043
|
* @param {string|number} [group=0]
|
|
1044
|
-
* @returns {
|
|
1044
|
+
* @returns {number}
|
|
1045
1045
|
*/
|
|
1046
1046
|
end(group = 0) {
|
|
1047
1047
|
if (typeof group === 'string') {
|
|
@@ -1072,7 +1072,7 @@ class Matcher {
|
|
|
1072
1072
|
/**
|
|
1073
1073
|
* Returns the named group of the most recent match, or {@code null} if the group was not matched.
|
|
1074
1074
|
* @param {string|number} [group=0]
|
|
1075
|
-
* @returns {string}
|
|
1075
|
+
* @returns {?string}
|
|
1076
1076
|
*/
|
|
1077
1077
|
group(group = 0) {
|
|
1078
1078
|
if (typeof group === 'string') {
|
|
@@ -1929,7 +1929,6 @@ class Machine {
|
|
|
1929
1929
|
} else {
|
|
1930
1930
|
flag = input.context(pos);
|
|
1931
1931
|
}
|
|
1932
|
-
// eslint-disable-next-line no-constant-condition
|
|
1933
1932
|
while (true) {
|
|
1934
1933
|
if (runq.isEmpty()) {
|
|
1935
1934
|
if ((startCond & Utils.EMPTY_BEGIN_TEXT) !== 0 && pos !== 0) {
|
|
@@ -3741,7 +3740,6 @@ class Parser {
|
|
|
3741
3740
|
if (c === Codepoint.CODES.get('{')) {
|
|
3742
3741
|
let nhex = 0;
|
|
3743
3742
|
let r = 0;
|
|
3744
|
-
// eslint-disable-next-line no-constant-condition
|
|
3745
3743
|
while (true) {
|
|
3746
3744
|
if (!t.more()) {
|
|
3747
3745
|
break bigswitch;
|