libphonenumber-js 1.10.6 → 1.10.7

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.
Files changed (47) hide show
  1. package/build/AsYouType.test.js +26 -8
  2. package/build/AsYouType.test.js.map +1 -1
  3. package/build/AsYouTypeFormatter.PatternMatcher.js +36 -224
  4. package/build/AsYouTypeFormatter.PatternMatcher.js.map +1 -1
  5. package/build/AsYouTypeFormatter.PatternMatcher.test.js +9 -0
  6. package/build/AsYouTypeFormatter.PatternMatcher.test.js.map +1 -1
  7. package/build/AsYouTypeFormatter.PatternParser.js +241 -0
  8. package/build/AsYouTypeFormatter.PatternParser.js.map +1 -0
  9. package/build/AsYouTypeFormatter.PatternParser.test.js +49 -0
  10. package/build/AsYouTypeFormatter.PatternParser.test.js.map +1 -0
  11. package/build/AsYouTypeFormatter.js.map +1 -1
  12. package/bundle/libphonenumber-js.min.js +1 -1
  13. package/bundle/libphonenumber-js.min.js.map +1 -1
  14. package/bundle/libphonenumber-max.js +1 -1
  15. package/bundle/libphonenumber-max.js.map +1 -1
  16. package/bundle/libphonenumber-min.js +1 -1
  17. package/bundle/libphonenumber-min.js.map +1 -1
  18. package/bundle/libphonenumber-mobile.js +1 -1
  19. package/bundle/libphonenumber-mobile.js.map +1 -1
  20. package/es6/AsYouType.test.js +26 -8
  21. package/es6/AsYouType.test.js.map +1 -1
  22. package/es6/AsYouTypeFormatter.PatternMatcher.js +33 -223
  23. package/es6/AsYouTypeFormatter.PatternMatcher.js.map +1 -1
  24. package/es6/AsYouTypeFormatter.PatternMatcher.test.js +9 -0
  25. package/es6/AsYouTypeFormatter.PatternMatcher.test.js.map +1 -1
  26. package/es6/AsYouTypeFormatter.PatternParser.js +234 -0
  27. package/es6/AsYouTypeFormatter.PatternParser.js.map +1 -0
  28. package/es6/AsYouTypeFormatter.PatternParser.test.js +44 -0
  29. package/es6/AsYouTypeFormatter.PatternParser.test.js.map +1 -0
  30. package/es6/AsYouTypeFormatter.js.map +1 -1
  31. package/metadata.full.json +1 -1
  32. package/metadata.full.json.js +1 -1
  33. package/metadata.max.json +1 -1
  34. package/metadata.max.json.js +1 -1
  35. package/metadata.min.json +1 -1
  36. package/metadata.min.json.js +1 -1
  37. package/metadata.mobile.json +1 -1
  38. package/metadata.mobile.json.js +1 -1
  39. package/package.json +1 -1
  40. package/source/AsYouType.test.js +25 -6
  41. package/source/AsYouTypeFormatter.PatternMatcher.d.ts +66 -0
  42. package/source/AsYouTypeFormatter.PatternMatcher.js +30 -206
  43. package/source/AsYouTypeFormatter.PatternMatcher.test.js +8 -0
  44. package/source/AsYouTypeFormatter.PatternParser.d.ts +58 -0
  45. package/source/AsYouTypeFormatter.PatternParser.js +214 -0
  46. package/source/AsYouTypeFormatter.PatternParser.test.js +67 -0
  47. package/source/AsYouTypeFormatter.js +2 -0
@@ -10,6 +10,8 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
10
10
 
11
11
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
12
12
 
13
+ import PatternParser from './AsYouTypeFormatter.PatternParser.js';
14
+
13
15
  var PatternMatcher = /*#__PURE__*/function () {
14
16
  function PatternMatcher(pattern) {
15
17
  _classCallCheck(this, PatternMatcher);
@@ -45,20 +47,25 @@ var PatternMatcher = /*#__PURE__*/function () {
45
47
 
46
48
  return PatternMatcher;
47
49
  }();
50
+ /**
51
+ * Matches `characters` against a pattern compiled into a `tree`.
52
+ * @param {string[]} characters
53
+ * @param {Tree} tree — A pattern compiled into a `tree`. See the `*.d.ts` file for the description of the `tree` structure.
54
+ * @param {boolean} last — Whether it's the last (rightmost) subtree on its level of the match tree.
55
+ * @return {object} See the `*.d.ts` file for the description of the result object.
56
+ */
57
+
48
58
 
49
59
  export { PatternMatcher as default };
50
60
 
51
61
  function _match(characters, tree, last) {
62
+ // If `tree` is a string, then `tree` is a single character.
63
+ // That's because when a pattern is parsed, multi-character-string parts
64
+ // of a pattern are compiled into arrays of single characters.
65
+ // I still wrote this piece of code for a "general" hypothetical case
66
+ // when `tree` could be a string of several characters, even though
67
+ // such case is not possible with the current implementation.
52
68
  if (typeof tree === 'string') {
53
- if (last) {
54
- // `tree` is always a single character.
55
- if (characters.length > tree.length) {
56
- return {
57
- overflow: true
58
- };
59
- }
60
- }
61
-
62
69
  var characterString = characters.join('');
63
70
 
64
71
  if (tree.indexOf(characterString) === 0) {
@@ -86,6 +93,23 @@ function _match(characters, tree, last) {
86
93
  }
87
94
 
88
95
  if (characterString.indexOf(tree) === 0) {
96
+ if (last) {
97
+ // The `else` path is not possible because `tree` is always a single character.
98
+ // The `else` case for `characters.length > tree.length` would be
99
+ // `characters.length <= tree.length` which means `characters.length <= 1`.
100
+ // `characters` array can't be empty, so that means `characters === [tree]`,
101
+ // which would also mean `tree.indexOf(characterString) === 0` and that'd mean
102
+ // that the `if (tree.indexOf(characterString) === 0)` condition before this
103
+ // `if` condition would be entered, and returned from there, not reaching this code.
104
+
105
+ /* istanbul ignore else */
106
+ if (characters.length > tree.length) {
107
+ return {
108
+ overflow: true
109
+ };
110
+ }
111
+ }
112
+
89
113
  return {
90
114
  match: true,
91
115
  matchedChars: characters.slice(0, tree.length)
@@ -228,218 +252,4 @@ function _match(characters, tree, last) {
228
252
  throw new Error("Unsupported instruction tree: ".concat(tree));
229
253
  }
230
254
  }
231
-
232
- var OPERATOR = new RegExp( // any of:
233
- '(' + // or operator
234
- '\\|' + // or
235
- '|' + // or group start
236
- '\\(\\?\\:' + // or
237
- '|' + // or group end
238
- '\\)' + // or
239
- '|' + // one-of set start
240
- '\\[' + // or
241
- '|' + // one-of set end
242
- '\\]' + ')');
243
- var ILLEGAL_CHARACTER_REGEXP = /[\(\)\[\]\?\:\|]/;
244
-
245
- var PatternParser = /*#__PURE__*/function () {
246
- function PatternParser() {
247
- _classCallCheck(this, PatternParser);
248
- }
249
-
250
- _createClass(PatternParser, [{
251
- key: "parse",
252
- value: function parse(pattern) {
253
- this.context = [{
254
- or: true,
255
- instructions: []
256
- }];
257
- this.parsePattern(pattern);
258
-
259
- if (this.context.length !== 1) {
260
- throw new Error('Non-finalized contexts left when pattern parse ended');
261
- }
262
-
263
- var _this$context$ = this.context[0],
264
- branches = _this$context$.branches,
265
- instructions = _this$context$.instructions;
266
-
267
- if (branches) {
268
- return [{
269
- op: '|',
270
- args: branches.concat([instructions])
271
- }];
272
- }
273
- /* istanbul ignore if */
274
-
275
-
276
- if (instructions.length === 0) {
277
- throw new Error('Pattern is required');
278
- }
279
-
280
- return instructions;
281
- }
282
- }, {
283
- key: "startContext",
284
- value: function startContext(context) {
285
- this.context.push(context);
286
- }
287
- }, {
288
- key: "endContext",
289
- value: function endContext() {
290
- this.context.pop();
291
- }
292
- }, {
293
- key: "getContext",
294
- value: function getContext() {
295
- return this.context[this.context.length - 1];
296
- }
297
- }, {
298
- key: "parsePattern",
299
- value: function parsePattern(pattern) {
300
- if (!pattern) {
301
- throw new Error('Pattern is required');
302
- }
303
-
304
- var match = pattern.match(OPERATOR);
305
-
306
- if (!match) {
307
- if (ILLEGAL_CHARACTER_REGEXP.test(pattern)) {
308
- throw new Error("Illegal characters found in a pattern: ".concat(pattern));
309
- }
310
-
311
- this.getContext().instructions = this.getContext().instructions.concat(pattern.split(''));
312
- return;
313
- }
314
-
315
- var operator = match[1];
316
- var before = pattern.slice(0, match.index);
317
- var rightPart = pattern.slice(match.index + operator.length);
318
-
319
- switch (operator) {
320
- case '(?:':
321
- if (before) {
322
- this.parsePattern(before);
323
- }
324
-
325
- this.startContext({
326
- or: true,
327
- instructions: [],
328
- branches: []
329
- });
330
- break;
331
-
332
- case ')':
333
- if (!this.getContext().or) {
334
- throw new Error('")" operator must be preceded by "(?:" operator');
335
- }
336
-
337
- if (before) {
338
- this.parsePattern(before);
339
- }
340
-
341
- if (this.getContext().instructions.length === 0) {
342
- throw new Error('No instructions found after "|" operator in an "or" group');
343
- }
344
-
345
- var _this$getContext = this.getContext(),
346
- branches = _this$getContext.branches;
347
-
348
- branches.push(this.getContext().instructions);
349
- this.endContext();
350
- this.getContext().instructions.push({
351
- op: '|',
352
- args: branches
353
- });
354
- break;
355
-
356
- case '|':
357
- if (!this.getContext().or) {
358
- throw new Error('"|" operator can only be used inside "or" groups');
359
- }
360
-
361
- if (before) {
362
- this.parsePattern(before);
363
- } // The top-level is an implicit "or" group, if required.
364
-
365
-
366
- if (!this.getContext().branches) {
367
- // `branches` are not defined only for the root implicit "or" operator.
368
-
369
- /* istanbul ignore else */
370
- if (this.context.length === 1) {
371
- this.getContext().branches = [];
372
- } else {
373
- throw new Error('"branches" not found in an "or" group context');
374
- }
375
- }
376
-
377
- this.getContext().branches.push(this.getContext().instructions);
378
- this.getContext().instructions = [];
379
- break;
380
-
381
- case '[':
382
- if (before) {
383
- this.parsePattern(before);
384
- }
385
-
386
- this.startContext({
387
- oneOfSet: true
388
- });
389
- break;
390
-
391
- case ']':
392
- if (!this.getContext().oneOfSet) {
393
- throw new Error('"]" operator must be preceded by "[" operator');
394
- }
395
-
396
- this.endContext();
397
- this.getContext().instructions.push({
398
- op: '[]',
399
- args: parseOneOfSet(before)
400
- });
401
- break;
402
-
403
- /* istanbul ignore next */
404
-
405
- default:
406
- throw new Error("Unknown operator: ".concat(operator));
407
- }
408
-
409
- if (rightPart) {
410
- this.parsePattern(rightPart);
411
- }
412
- }
413
- }]);
414
-
415
- return PatternParser;
416
- }();
417
-
418
- function parseOneOfSet(pattern) {
419
- var values = [];
420
- var i = 0;
421
-
422
- while (i < pattern.length) {
423
- if (pattern[i] === '-') {
424
- if (i === 0 || i === pattern.length - 1) {
425
- throw new Error("Couldn't parse a one-of set pattern: ".concat(pattern));
426
- }
427
-
428
- var prevValue = pattern[i - 1].charCodeAt(0) + 1;
429
- var nextValue = pattern[i + 1].charCodeAt(0) - 1;
430
- var value = prevValue;
431
-
432
- while (value <= nextValue) {
433
- values.push(String.fromCharCode(value));
434
- value++;
435
- }
436
- } else {
437
- values.push(pattern[i]);
438
- }
439
-
440
- i++;
441
- }
442
-
443
- return values;
444
- }
445
255
  //# sourceMappingURL=AsYouTypeFormatter.PatternMatcher.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AsYouTypeFormatter.PatternMatcher.js","names":["PatternMatcher","pattern","matchTree","PatternParser","parse","string","allowOverflow","Error","result","match","split","matchedChars","overflow","characters","tree","last","length","characterString","join","indexOf","partialMatch","slice","Array","isArray","restCharacters","i","subtree","JSON","stringify","op","args","branch","char","OPERATOR","RegExp","ILLEGAL_CHARACTER_REGEXP","context","or","instructions","parsePattern","branches","concat","push","pop","test","getContext","operator","before","index","rightPart","startContext","endContext","oneOfSet","parseOneOfSet","values","prevValue","charCodeAt","nextValue","value","String","fromCharCode"],"sources":["../source/AsYouTypeFormatter.PatternMatcher.js"],"sourcesContent":["export default class PatternMatcher {\r\n\tconstructor(pattern) {\r\n\t\tthis.matchTree = new PatternParser().parse(pattern)\r\n\t}\r\n\r\n\tmatch(string, { allowOverflow } = {}) {\r\n\t\tif (!string) {\r\n\t\t\tthrow new Error('String is required')\r\n\t\t}\r\n\t\tconst result = match(string.split(''), this.matchTree, true)\r\n\t\tif (result && result.match) {\r\n\t\t\tdelete result.matchedChars\r\n\t\t}\r\n\t\tif (result && result.overflow) {\r\n\t\t\tif (!allowOverflow) {\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result\r\n\t}\r\n}\r\n\r\nfunction match(characters, tree, last) {\r\n\tif (typeof tree === 'string') {\r\n\t\tif (last) {\r\n\t\t\t// `tree` is always a single character.\r\n\t\t\tif (characters.length > tree.length) {\r\n\t\t\t\treturn {\r\n\t\t\t\t\toverflow: true\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tconst characterString = characters.join('')\r\n\t\tif (tree.indexOf(characterString) === 0) {\r\n\t\t\t// `tree` is always a single character.\r\n\t\t\t// If `tree.indexOf(characterString) === 0`\r\n\t\t\t// then `characters.length === tree.length`.\r\n\t\t\t/* istanbul ignore else */\r\n\t\t\tif (characters.length === tree.length) {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tmatch: true,\r\n\t\t\t\t\tmatchedChars: characters\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// `tree` is always a single character.\r\n\t\t\t// If `tree.indexOf(characterString) === 0`\r\n\t\t\t// then `characters.length === tree.length`.\r\n\t\t\t/* istanbul ignore next */\r\n\t\t\treturn {\r\n\t\t\t\tpartialMatch: true,\r\n\t\t\t\t// matchedChars: characters\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (characterString.indexOf(tree) === 0) {\r\n\t\t\treturn {\r\n\t\t\t\tmatch: true,\r\n\t\t\t\tmatchedChars: characters.slice(0, tree.length)\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn\r\n\t}\r\n\r\n\tif (Array.isArray(tree)) {\r\n\t\tlet restCharacters = characters.slice()\r\n\t\tlet i = 0\r\n\t\twhile (i < tree.length) {\r\n\t\t\tconst subtree = tree[i]\r\n\t\t\tconst result = match(restCharacters, subtree, last && (i === tree.length - 1))\r\n\t\t\tif (!result) {\r\n\t\t\t\treturn\r\n\t\t\t} else if (result.overflow) {\r\n\t\t\t\treturn result\r\n\t\t\t} else if (result.match) {\r\n\t\t\t\t// Continue with the next subtree with the rest of the characters.\r\n\t\t\t\trestCharacters = restCharacters.slice(result.matchedChars.length)\r\n\t\t\t\tif (restCharacters.length === 0) {\r\n\t\t\t\t\tif (i === tree.length - 1) {\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tmatch: true,\r\n\t\t\t\t\t\t\tmatchedChars: characters\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tpartialMatch: true,\r\n\t\t\t\t\t\t\t// matchedChars: characters\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t/* istanbul ignore else */\r\n\t\t\t\tif (result.partialMatch) {\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\tpartialMatch: true,\r\n\t\t\t\t\t\t// matchedChars: characters\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthrow new Error(`Unsupported match result:\\n${JSON.stringify(result, null, 2)}`)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ti++\r\n\t\t}\r\n\t\t// If `last` then overflow has already been checked\r\n\t\t// by the last element of the `tree` array.\r\n\t\t/* istanbul ignore if */\r\n\t\tif (last) {\r\n\t\t\treturn {\r\n\t\t\t\toverflow: true\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn {\r\n\t\t\tmatch: true,\r\n\t\t\tmatchedChars: characters.slice(0, characters.length - restCharacters.length)\r\n\t\t}\r\n\t}\r\n\r\n\tswitch (tree.op) {\r\n\t\tcase '|':\r\n\t\t\tlet partialMatch\r\n\t\t\tfor (const branch of tree.args) {\r\n\t\t\t\tconst result = match(characters, branch, last)\r\n\t\t\t\tif (result) {\r\n\t\t\t\t\tif (result.overflow) {\r\n\t\t\t\t\t\treturn result\r\n\t\t\t\t\t} else if (result.match) {\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tmatch: true,\r\n\t\t\t\t\t\t\tmatchedChars: result.matchedChars\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t/* istanbul ignore else */\r\n\t\t\t\t\t\tif (result.partialMatch) {\r\n\t\t\t\t\t\t\tpartialMatch = true\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tthrow new Error(`Unsupported match result:\\n${JSON.stringify(result, null, 2)}`)\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (partialMatch) {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tpartialMatch: true,\r\n\t\t\t\t\t// matchedChars: ...\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Not even a partial match.\r\n\t\t\treturn\r\n\r\n\t\tcase '[]':\r\n\t\t\tfor (const char of tree.args) {\r\n\t\t\t\tif (characters[0] === char) {\r\n\t\t\t\t\tif (characters.length === 1) {\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tmatch: true,\r\n\t\t\t\t\t\t\tmatchedChars: characters\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (last) {\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\toverflow: true\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\tmatch: true,\r\n\t\t\t\t\t\tmatchedChars: [char]\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// No character matches.\r\n\t\t\treturn\r\n\r\n\t\t/* istanbul ignore next */\r\n\t\tdefault:\r\n\t\t\tthrow new Error(`Unsupported instruction tree: ${tree}`)\r\n\t}\r\n}\r\n\r\nconst OPERATOR = new RegExp(\r\n\t// any of:\r\n\t'(' +\r\n\t\t// or operator\r\n\t\t'\\\\|' +\r\n\t\t// or\r\n\t\t'|' +\r\n\t\t// or group start\r\n\t\t'\\\\(\\\\?\\\\:' +\r\n\t\t// or\r\n\t\t'|' +\r\n\t\t// or group end\r\n\t\t'\\\\)' +\r\n\t\t// or\r\n\t\t'|' +\r\n\t\t// one-of set start\r\n\t\t'\\\\[' +\r\n\t\t// or\r\n\t\t'|' +\r\n\t\t// one-of set end\r\n\t\t'\\\\]' +\r\n\t')'\r\n)\r\n\r\nconst ILLEGAL_CHARACTER_REGEXP = /[\\(\\)\\[\\]\\?\\:\\|]/\r\n\r\nclass PatternParser {\r\n\tparse(pattern) {\r\n\t\tthis.context = [{\r\n\t\t\tor: true,\r\n\t\t\tinstructions: []\r\n\t\t}]\r\n\r\n\t\tthis.parsePattern(pattern)\r\n\r\n\t\tif (this.context.length !== 1) {\r\n\t\t\tthrow new Error('Non-finalized contexts left when pattern parse ended')\r\n\t\t}\r\n\r\n\t\tconst { branches, instructions } = this.context[0]\r\n\r\n\t\tif (branches) {\r\n\t\t\treturn [{\r\n\t\t\t\top: '|',\r\n\t\t\t\targs: branches.concat([instructions])\r\n\t\t\t}]\r\n\t\t}\r\n\r\n\t\t/* istanbul ignore if */\r\n\t\tif (instructions.length === 0) {\r\n\t\t\tthrow new Error('Pattern is required')\r\n\t\t}\r\n\r\n\t\treturn instructions\r\n\t}\r\n\r\n\tstartContext(context) {\r\n\t\tthis.context.push(context)\r\n\t}\r\n\r\n\tendContext() {\r\n\t\tthis.context.pop()\r\n\t}\r\n\r\n\tgetContext() {\r\n\t\treturn this.context[this.context.length - 1]\r\n\t}\r\n\r\n\tparsePattern(pattern) {\r\n\t\tif (!pattern) {\r\n\t\t\tthrow new Error('Pattern is required')\r\n\t\t}\r\n\r\n\t\tconst match = pattern.match(OPERATOR)\r\n\t\tif (!match) {\r\n\t\t\tif (ILLEGAL_CHARACTER_REGEXP.test(pattern)) {\r\n\t\t\t\tthrow new Error(`Illegal characters found in a pattern: ${pattern}`)\r\n\t\t\t}\r\n\t\t\tthis.getContext().instructions = this.getContext().instructions.concat(\r\n\t\t\t\tpattern.split('')\r\n\t\t\t)\r\n\t\t\treturn\r\n\t\t}\r\n\r\n\t\tconst operator = match[1]\r\n\t\tconst before = pattern.slice(0, match.index)\r\n\t\tconst rightPart = pattern.slice(match.index + operator.length)\r\n\r\n\t\tswitch (operator) {\r\n\t\t\tcase '(?:':\r\n\t\t\t\tif (before) {\r\n\t\t\t\t\tthis.parsePattern(before)\r\n\t\t\t\t}\r\n\t\t\t\tthis.startContext({\r\n\t\t\t\t\tor: true,\r\n\t\t\t\t\tinstructions: [],\r\n\t\t\t\t\tbranches: []\r\n\t\t\t\t})\r\n\t\t\t\tbreak\r\n\r\n\t\t\tcase ')':\r\n\t\t\t\tif (!this.getContext().or) {\r\n\t\t\t\t\tthrow new Error('\")\" operator must be preceded by \"(?:\" operator')\r\n\t\t\t\t}\r\n\t\t\t\tif (before) {\r\n\t\t\t\t\tthis.parsePattern(before)\r\n\t\t\t\t}\r\n\t\t\t\tif (this.getContext().instructions.length === 0) {\r\n\t\t\t\t\tthrow new Error('No instructions found after \"|\" operator in an \"or\" group')\r\n\t\t\t\t}\r\n\t\t\t\tconst { branches } = this.getContext()\r\n\t\t\t\tbranches.push(\r\n\t\t\t\t\tthis.getContext().instructions\r\n\t\t\t\t)\r\n\t\t\t\tthis.endContext()\r\n\t\t\t\tthis.getContext().instructions.push({\r\n\t\t\t\t\top: '|',\r\n\t\t\t\t\targs: branches\r\n\t\t\t\t})\r\n\t\t\t\tbreak\r\n\r\n\t\t\tcase '|':\r\n\t\t\t\tif (!this.getContext().or) {\r\n\t\t\t\t\tthrow new Error('\"|\" operator can only be used inside \"or\" groups')\r\n\t\t\t\t}\r\n\t\t\t\tif (before) {\r\n\t\t\t\t\tthis.parsePattern(before)\r\n\t\t\t\t}\r\n\t\t\t\t// The top-level is an implicit \"or\" group, if required.\r\n\t\t\t\tif (!this.getContext().branches) {\r\n\t\t\t\t\t// `branches` are not defined only for the root implicit \"or\" operator.\r\n\t\t\t\t\t/* istanbul ignore else */\r\n\t\t\t\t\tif (this.context.length === 1) {\r\n\t\t\t\t\t\tthis.getContext().branches = []\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthrow new Error('\"branches\" not found in an \"or\" group context')\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tthis.getContext().branches.push(\r\n\t\t\t\t\tthis.getContext().instructions\r\n\t\t\t\t)\r\n\t\t\t\tthis.getContext().instructions = []\r\n\t\t\t\tbreak\r\n\r\n\t\t\tcase '[':\r\n\t\t\t\tif (before) {\r\n\t\t\t\t\tthis.parsePattern(before)\r\n\t\t\t\t}\r\n\t\t\t\tthis.startContext({\r\n\t\t\t\t\toneOfSet: true\r\n\t\t\t\t})\r\n\t\t\t\tbreak\r\n\r\n\t\t\tcase ']':\r\n\t\t\t\tif (!this.getContext().oneOfSet) {\r\n\t\t\t\t\tthrow new Error('\"]\" operator must be preceded by \"[\" operator')\r\n\t\t\t\t}\r\n\t\t\t\tthis.endContext()\r\n\t\t\t\tthis.getContext().instructions.push({\r\n\t\t\t\t\top: '[]',\r\n\t\t\t\t\targs: parseOneOfSet(before)\r\n\t\t\t\t})\r\n\t\t\t\tbreak\r\n\r\n\t\t\t/* istanbul ignore next */\r\n\t\t\tdefault:\r\n\t\t\t\tthrow new Error(`Unknown operator: ${operator}`)\r\n\t\t}\r\n\r\n\t\tif (rightPart) {\r\n\t\t\tthis.parsePattern(rightPart)\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction parseOneOfSet(pattern) {\r\n\tconst values = []\r\n\tlet i = 0\r\n\twhile (i < pattern.length) {\r\n\t\tif (pattern[i] === '-') {\r\n\t\t\tif (i === 0 || i === pattern.length - 1) {\r\n\t\t\t\tthrow new Error(`Couldn't parse a one-of set pattern: ${pattern}`)\r\n\t\t\t}\r\n\t\t\tconst prevValue = pattern[i - 1].charCodeAt(0) + 1\r\n\t\t\tconst nextValue = pattern[i + 1].charCodeAt(0) - 1\r\n\t\t\tlet value = prevValue\r\n\t\t\twhile (value <= nextValue) {\r\n\t\t\t\tvalues.push(String.fromCharCode(value))\r\n\t\t\t\tvalue++\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvalues.push(pattern[i])\r\n\t\t}\r\n\t\ti++\r\n\t}\r\n\treturn values\r\n}"],"mappings":";;;;;;;;;;;;IAAqBA,c;EACpB,wBAAYC,OAAZ,EAAqB;IAAA;;IACpB,KAAKC,SAAL,GAAiB,IAAIC,aAAJ,GAAoBC,KAApB,CAA0BH,OAA1B,CAAjB;EACA;;;;WAED,eAAMI,MAAN,EAAsC;MAAA,+EAAJ,EAAI;MAAA,IAAtBC,aAAsB,QAAtBA,aAAsB;;MACrC,IA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AP,CAAYiB,MAAM,CAACC,YAAP,CAAoBF,KAApB,CAAZ;QACAA,KAAK;MACL;IACD,CAXD,MAWO;MACNJ,MAAM,CAACZ,IAAP,CAAYzC,OAAO,CAACwB,CAAD,CAAnB;IACA;;IACDA,CAAC;EACD;;EACD,OAAO6B,MAAP;AACA"}
1
+ {"version":3,"file":"AsYouTypeFormatter.PatternMatcher.js","names":["PatternParser","PatternMatcher","pattern","matchTree","parse","string","allowOverflow","Error","result","match","split","matchedChars","overflow","characters","tree","last","characterString","join","indexOf","length","partialMatch","slice","Array","isArray","restCharacters","i","subtree","JSON","stringify","op","args","branch","char"],"sources":["../source/AsYouTypeFormatter.PatternMatcher.js"],"sourcesContent":["import PatternParser from './AsYouTypeFormatter.PatternParser.js'\r\n\r\nexport default class PatternMatcher {\r\n\tconstructor(pattern) {\r\n\t\tthis.matchTree = new PatternParser().parse(pattern)\r\n\t}\r\n\r\n\tmatch(string, { allowOverflow } = {}) {\r\n\t\tif (!string) {\r\n\t\t\tthrow new Error('String is required')\r\n\t\t}\r\n\t\tconst result = match(string.split(''), this.matchTree, true)\r\n\t\tif (result && result.match) {\r\n\t\t\tdelete result.matchedChars\r\n\t\t}\r\n\t\tif (result && result.overflow) {\r\n\t\t\tif (!allowOverflow) {\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result\r\n\t}\r\n}\r\n\r\n/**\r\n * Matches `characters` against a pattern compiled into a `tree`.\r\n * @param {string[]} characters\r\n * @param {Tree} tree — A pattern compiled into a `tree`. See the `*.d.ts` file for the description of the `tree` structure.\r\n * @param {boolean} last — Whether it's the last (rightmost) subtree on its level of the match tree.\r\n * @return {object} See the `*.d.ts` file for the description of the result object.\r\n */\r\nfunction match(characters, tree, last) {\r\n\t// If `tree` is a string, then `tree` is a single character.\r\n\t// That's because when a pattern is parsed, multi-character-string parts\r\n\t// of a pattern are compiled into arrays of single characters.\r\n\t// I still wrote this piece of code for a \"general\" hypothetical case\r\n\t// when `tree` could be a string of several characters, even though\r\n\t// such case is not possible with the current implementation.\r\n\tif (typeof tree === 'string') {\r\n\t\tconst characterString = characters.join('')\r\n\t\tif (tree.indexOf(characterString) === 0) {\r\n\t\t\t// `tree` is always a single character.\r\n\t\t\t// If `tree.indexOf(characterString) === 0`\r\n\t\t\t// then `characters.length === tree.length`.\r\n\t\t\t/* istanbul ignore else */\r\n\t\t\tif (characters.length === tree.length) {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tmatch: true,\r\n\t\t\t\t\tmatchedChars: characters\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// `tree` is always a single character.\r\n\t\t\t// If `tree.indexOf(characterString) === 0`\r\n\t\t\t// then `characters.length === tree.length`.\r\n\t\t\t/* istanbul ignore next */\r\n\t\t\treturn {\r\n\t\t\t\tpartialMatch: true,\r\n\t\t\t\t// matchedChars: characters\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (characterString.indexOf(tree) === 0) {\r\n\t\t\tif (last) {\r\n\t\t\t\t// The `else` path is not possible because `tree` is always a single character.\r\n\t\t\t\t// The `else` case for `characters.length > tree.length` would be\r\n\t\t\t\t// `characters.length <= tree.length` which means `characters.length <= 1`.\r\n\t\t\t\t// `characters` array can't be empty, so that means `characters === [tree]`,\r\n\t\t\t\t// which would also mean `tree.indexOf(characterString) === 0` and that'd mean\r\n\t\t\t\t// that the `if (tree.indexOf(characterString) === 0)` condition before this\r\n\t\t\t\t// `if` condition would be entered, and returned from there, not reaching this code.\r\n\t\t\t\t/* istanbul ignore else */\r\n\t\t\t\tif (characters.length > tree.length) {\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\toverflow: true\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn {\r\n\t\t\t\tmatch: true,\r\n\t\t\t\tmatchedChars: characters.slice(0, tree.length)\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn\r\n\t}\r\n\r\n\tif (Array.isArray(tree)) {\r\n\t\tlet restCharacters = characters.slice()\r\n\t\tlet i = 0\r\n\t\twhile (i < tree.length) {\r\n\t\t\tconst subtree = tree[i]\r\n\t\t\tconst result = match(restCharacters, subtree, last && (i === tree.length - 1))\r\n\t\t\tif (!result) {\r\n\t\t\t\treturn\r\n\t\t\t} else if (result.overflow) {\r\n\t\t\t\treturn result\r\n\t\t\t} else if (result.match) {\r\n\t\t\t\t// Continue with the next subtree with the rest of the characters.\r\n\t\t\t\trestCharacters = restCharacters.slice(result.matchedChars.length)\r\n\t\t\t\tif (restCharacters.length === 0) {\r\n\t\t\t\t\tif (i === tree.length - 1) {\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tmatch: true,\r\n\t\t\t\t\t\t\tmatchedChars: characters\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tpartialMatch: true,\r\n\t\t\t\t\t\t\t// matchedChars: characters\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t/* istanbul ignore else */\r\n\t\t\t\tif (result.partialMatch) {\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\tpartialMatch: true,\r\n\t\t\t\t\t\t// matchedChars: characters\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthrow new Error(`Unsupported match result:\\n${JSON.stringify(result, null, 2)}`)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ti++\r\n\t\t}\r\n\t\t// If `last` then overflow has already been checked\r\n\t\t// by the last element of the `tree` array.\r\n\t\t/* istanbul ignore if */\r\n\t\tif (last) {\r\n\t\t\treturn {\r\n\t\t\t\toverflow: true\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn {\r\n\t\t\tmatch: true,\r\n\t\t\tmatchedChars: characters.slice(0, characters.length - restCharacters.length)\r\n\t\t}\r\n\t}\r\n\r\n\tswitch (tree.op) {\r\n\t\tcase '|':\r\n\t\t\tlet partialMatch\r\n\t\t\tfor (const branch of tree.args) {\r\n\t\t\t\tconst result = match(characters, branch, last)\r\n\t\t\t\tif (result) {\r\n\t\t\t\t\tif (result.overflow) {\r\n\t\t\t\t\t\treturn result\r\n\t\t\t\t\t} else if (result.match) {\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tmatch: true,\r\n\t\t\t\t\t\t\tmatchedChars: result.matchedChars\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t/* istanbul ignore else */\r\n\t\t\t\t\t\tif (result.partialMatch) {\r\n\t\t\t\t\t\t\tpartialMatch = true\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tthrow new Error(`Unsupported match result:\\n${JSON.stringify(result, null, 2)}`)\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (partialMatch) {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tpartialMatch: true,\r\n\t\t\t\t\t// matchedChars: ...\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Not even a partial match.\r\n\t\t\treturn\r\n\r\n\t\tcase '[]':\r\n\t\t\tfor (const char of tree.args) {\r\n\t\t\t\tif (characters[0] === char) {\r\n\t\t\t\t\tif (characters.length === 1) {\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tmatch: true,\r\n\t\t\t\t\t\t\tmatchedChars: characters\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (last) {\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\toverflow: true\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\tmatch: true,\r\n\t\t\t\t\t\tmatchedChars: [char]\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// No character matches.\r\n\t\t\treturn\r\n\r\n\t\t/* istanbul ignore next */\r\n\t\tdefault:\r\n\t\t\tthrow new Error(`Unsupported instruction tree: ${tree}`)\r\n\t}\r\n}"],"mappings":";;;;;;;;;;;;AAAA,OAAOA,aAAP,MAA0B,uCAA1B;;IAEqBC,c;EACpB,wBAAYC,OAAZ,EAAqB;IAAA;;IACpB,KAAKC,SAAL,GAAiB,IAAIH,aAAJ,GAAoBI,KAApB,CAA0BF,OAA1B,CAAjB;EACA;;;;WAED,eAAMG,MAAN,EAAsC;MAAA,+EAAJ,EAAI;MAAA,IAAtBC,aAAsB,QAAtBA,aAAsB;;MACrC,IAAI,CAACD,MAAL,EAAa;QACZ,MAAM,IAAIE,KAAJ,CAAU,oBAAV,CAAN;MACA;;MACD,IAAMC,MAAM,GAAGC,MAAK,CAACJ,MAAM,CAACK,KAAP,CAAa,EAAb,CAAD,EAAmB,KAAKP,SAAxB,EAAmC,IAAnC,CAApB;;MACA,IAAIK,MAAM,IAAIA,MAAM,CAACC,KAArB,EAA4B;QAC3B,OAAOD,MAAM,CAACG,YAAd;MACA;;MACD,IAAIH,MAAM,IAAIA,MAAM,CAACI,QAArB,EAA+B;QAC9B,IAAI,CAACN,aAAL,EAAoB;UACnB;QACA;MACD;;MACD,OAAOE,MAAP;IACA;;;;;AAGF;AACA;AACA;AACA;AACA;AACA;AACA;;;SA5BqBP,c;;AA6BrB,SAASQ,MAAT,CAAeI,UAAf,EAA2BC,IAA3B,EAAiCC,IAAjC,EAAuC;EACtC;EACA;EACA;EACA;EACA;EACA;EACA,IAAI,OAAOD,IAAP,KAAgB,QAApB,EAA8B;IAC7B,IAAME,eAAe,GAAGH,UAAU,CAACI,IAAX,CAAgB,EAAhB,CAAxB;;IACA,IAAIH,IAAI,CAACI,OAAL,CAAaF,eAAb,MAAkC,CAAtC,EAAyC;MACxC;MACA;MACA;;MACA;MACA,IAAIH,UAAU,CAACM,MAAX,KAAsBL,IAAI,CAACK,MAA/B,EAAuC;QACtC,OAAO;UACNV,KAAK,EA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AY,GAAG,IAAf;YACA,CAFD,MAEO;cACN,MAAM,IAAIb,KAAJ,sCAAwCoB,IAAI,CAACC,SAAL,CAAepB,OAAf,EAAuB,IAAvB,EAA6B,CAA7B,CAAxC,EAAN;YACA;UACD;QACD;MACD;;MACD,IAAIY,YAAJ,EAAkB;QACjB,OAAO;UACNA,YAAY,EAAE,IADR,CAEN;;QAFM,CAAP;MAIA,CA3BF,CA4BC;;;MACA;;IAED,KAAK,IAAL;MACC,sDAAmBN,IAAI,CAACgB,IAAxB,2CAA8B;QAAA,IAAnBE,KAAmB;;QAC7B,IAAInB,UAAU,CAAC,CAAD,CAAV,KAAkBmB,KAAtB,EAA4B;UAC3B,IAAInB,UAAU,CAACM,MAAX,KAAsB,CAA1B,EAA6B;YAC5B,OAAO;cACNV,KAAK,EAAE,IADD;cAENE,YAAY,EAAEE;YAFR,CAAP;UAIA;;UACD,IAAIE,IAAJ,EAAU;YACT,OAAO;cACNH,QAAQ,EAAE;YADJ,CAAP;UAGA;;UACD,OAAO;YACNH,KAAK,EAAE,IADD;YAENE,YAAY,EAAE,CAACqB,KAAD;UAFR,CAAP;QAIA;MACD,CAnBF,CAoBC;;;MACA;;IAED;;IACA;MACC,MAAM,IAAIzB,KAAJ,yCAA2CO,IAA3C,EAAN;EAzDF;AA2DA"}
@@ -484,5 +484,14 @@ describe('AsYouTypeFormatter.PatternMatcher', function () {
484
484
  match: true
485
485
  });
486
486
  });
487
+ it('shouldn\'t match things that shouldn\'t match', function () {
488
+ // There was a bug: "leading digits" `"2"` matched "leading digits pattern" `"90"`.
489
+ // The incorrect `.match()` function result was `{ oveflow: true }`
490
+ // while it should've been `undefined`.
491
+ // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/66
492
+ expect(new PatternMatcher('2').match('90', {
493
+ allowOverflow: true
494
+ })).to.be.undefined;
495
+ });
487
496
  });
488
497
  //# sourceMappingURL=AsYouTypeFormatter.PatternMatcher.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AsYouTypeFormatter.PatternMatcher.test.js","names":["PatternMatcher","describe","it","expect","to","matcher","match","be","undefined","should","deep","equal","allowOverflow","overflow","partialMatch"],"sources":["../source/AsYouTypeFormatter.PatternMatcher.test.js"],"sourcesContent":["import PatternMatcher from './AsYouTypeFormatter.PatternMatcher.js'\r\n\r\ndescribe('AsYouTypeFormatter.PatternMatcher', function() {\r\n\tit('should throw when no pattern is passed', function() {\r\n\t\texpect(() => new PatternMatcher()).to.throw('Pattern is required')\r\n\t})\r\n\r\n\tit('should throw when no string is passed', function() {\r\n\t\tconst matcher = new PatternMatcher('1')\r\n\t\texpect(() => matcher.match()).to.throw('String is required')\r\n\t})\r\n\r\n\tit('should throw on illegal characters', function() {\r\n\t\texpect(() => new PatternMatcher('4(5|6)7')).to.throw('Illegal characters')\r\n\t})\r\n\r\n\tit('should throw on an illegal ] operator', function() {\r\n\t\texpect(() => new PatternMatcher('4]7')).to.throw('\"]\" operator must be preceded by \"[\" operator')\r\n\t})\r\n\r\n\tit('should throw on an illegal - operator in a one-of set', function() {\r\n\t\texpect(() => new PatternMatcher('[-5]')).to.throw('Couldn\\'t parse a one-of set pattern: -5')\r\n\t})\r\n\r\n\tit('should throw on a non-finalized context', function() {\r\n\t\texpect(() => new PatternMatcher('4(?:5|7')).to.throw('Non-finalized contexts left when pattern parse ended')\r\n\t})\r\n\r\n\tit('should throw on an illegal (|) operator', function() {\r\n\t\texpect(() => new PatternMatcher('4(?:5|)7')).to.throw('No instructions found after \"|\" operator in an \"or\" group')\r\n\t})\r\n\r\n\tit('should throw on an illegal ) operator', function() {\r\n\t\texpect(() => new PatternMatcher('4[56)]7')).to.throw('\")\" operator must be preceded by \"(?:\" operator')\r\n\t})\r\n\r\n\tit('should throw on an illegal | operator', function() {\r\n\t\texpect(() => new PatternMatcher('4[5|6]7')).to.throw('operator can only be used inside \"or\" groups')\r\n\t})\r\n\r\n\tit('should match a one-digit pattern', function() {\r\n\t\tconst matcher = new PatternMatcher('4')\r\n\r\n\t\texpect(matcher.match('1')).to.be.undefined\r\n\r\n\t\tmatcher.match('4').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('44')).to.be.undefined\r\n\r\n\t\tmatcher.match('44', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\t})\r\n\r\n\tit('should match a two-digit pattern', function() {\r\n\t\tconst matcher = new PatternMatcher('44')\r\n\r\n\t\texpect(matcher.match('1')).to.be.undefined\r\n\r\n\t\tmatcher.match('4').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('44').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('444')).to.be.undefined\r\n\r\n\t\tmatcher.match('444', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('55')).to.be.undefined\r\n\t})\r\n\r\n\tit('should match a one-digit one-of set (single digit)', function() {\r\n\t\tconst matcher = new PatternMatcher('[4]')\r\n\r\n\t\texpect(matcher.match('1')).to.be.undefined\r\n\r\n\t\tmatcher.match('4').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('44')).to.be.undefined\r\n\r\n\t\tmatcher.match('44', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\t})\r\n\r\n\tit('should match a one-digit one-of set (multiple digits)', function() {\r\n\t\tconst matcher = new PatternMatcher('[479]')\r\n\r\n\t\texpect(matcher.match('1')).to.be.undefined\r\n\r\n\t\tmatcher.match('4').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('44')).to.be.undefined\r\n\r\n\t\tmatcher.match('44', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\t})\r\n\r\n\tit('should match a one-digit one-of set using a dash notation (not inclusive)', function() {\r\n\t\tconst matcher = new PatternMatcher('[2-5]')\r\n\r\n\t\texpect(matcher.match('1')).to.be.undefined\r\n\r\n\t\tmatcher.match('4').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('44')).to.be.undefined\r\n\r\n\t\tmatcher.match('44', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\t})\r\n\r\n\tit('should match a one-digit one-of set using a dash notation (inclusive)', function() {\r\n\t\tconst matcher = new PatternMatcher('[3-4]')\r\n\r\n\t\texpect(matcher.match('1')).to.be.undefined\r\n\r\n\t\tmatcher.match('4').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('44')).to.be.undefined\r\n\r\n\t\tmatcher.match('44', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\t})\r\n\r\n\tit('should match a one-digit one-of set including a dash notation', function() {\r\n\t\tconst matcher = new PatternMatcher('[124-68]')\r\n\r\n\t\texpect(matcher.match('0')).to.be.undefined\r\n\r\n\t\tmatcher.match('1').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('2').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('3')).to.be.undefined\r\n\r\n\t\tmatcher.match('4').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('5').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('6').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('7')).to.be.undefined\r\n\r\n\t\tmatcher.match('8').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('9')).to.be.undefined\r\n\r\n\t\texpect(matcher.match('88')).to.be.undefined\r\n\r\n\t\tmatcher.match('88', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\t})\r\n\r\n\tit('should match a two-digit one-of set', function() {\r\n\t\tconst matcher = new PatternMatcher('[479][45]')\r\n\r\n\t\texpect(matcher.match('1')).to.be.undefined\r\n\r\n\t\tmatcher.match('4').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('5')).to.be.undefined\r\n\t\texpect(matcher.match('55')).to.be.undefined\r\n\r\n\t\tmatcher.match('44').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('444')).to.be.undefined\r\n\r\n\t\tmatcher.match('444', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\t})\r\n\r\n\tit('should match a two-digit one-of set (regular digit and a one-of set)', function() {\r\n\t\tconst matcher = new PatternMatcher('1[45]')\r\n\r\n\t\texpect(matcher.match('0')).to.be.undefined\r\n\r\n\t\tmatcher.match('1').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('15').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('16')).to.be.undefined\r\n\t})\r\n\r\n\tit('should match a pattern with an or group', function() {\r\n\t\tconst matcher = new PatternMatcher('7(?:1[0-68]|2[1-9])')\r\n\r\n\t\texpect(matcher.match('1')).to.be.undefined\r\n\r\n\t\tmatcher.match('7').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('71').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('73')).to.be.undefined\r\n\r\n\t\tmatcher.match('711').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('717')).to.be.undefined\r\n\r\n\t\texpect(matcher.match('720')).to.be.undefined\r\n\r\n\t\tmatcher.match('722').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('7222')).to.be.undefined\r\n\r\n\t\tmatcher.match('7222', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\t})\r\n\r\n\tit('should match an or pattern containing or groups', function() {\r\n\t\tconst matcher = new PatternMatcher('2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])')\r\n\r\n\t\texpect(matcher.match('1')).to.be.undefined\r\n\r\n\t\tmatcher.match('2').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('3').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('4')).to.be.undefined\r\n\r\n\t\texpect(matcher.match('21')).to.be.undefined\r\n\r\n\t\tmatcher.match('22').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('221')).to.be.undefined\r\n\r\n\t\tmatcher.match('222').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('2222')).to.be.undefined\r\n\r\n\t\tmatcher.match('2222', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('3').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('33').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('332').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('333')).to.be.undefined\r\n\t})\r\n\r\n\tit('should match an or pattern', function() {\r\n\t\tconst matcher = new PatternMatcher('6|8')\r\n\r\n\t\texpect(matcher.match('5')).to.be.undefined\r\n\r\n\t\tmatcher.match('6').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('7')).to.be.undefined\r\n\r\n\t\tmatcher.match('8').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\t})\r\n\r\n\tit('should match an or pattern (one-of sets)', function() {\r\n\t\tconst matcher = new PatternMatcher('[123]|[5-8]')\r\n\r\n\t\texpect(matcher.match('0')).to.be.undefined\r\n\r\n\t\tmatcher.match('1').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('2').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('3').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('4')).to.be.undefined\r\n\r\n\t\tmatcher.match('5').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('6').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('7').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('8').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('9')).to.be.undefined\r\n\r\n\t\texpect(matcher.match('18')).to.be.undefined\r\n\r\n\t\tmatcher.match('18', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\t})\r\n\r\n\tit('should match an or pattern (different lengths)', function() {\r\n\t\tconst matcher = new PatternMatcher('60|8')\r\n\r\n\t\texpect(matcher.match('5')).to.be.undefined\r\n\r\n\t\tmatcher.match('6').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('60').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('61')).to.be.undefined\r\n\r\n\t\texpect(matcher.match('7')).to.be.undefined\r\n\r\n\t\tmatcher.match('8').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('68')).to.be.undefined\r\n\t})\r\n\r\n\tit('should match an or pattern (one-of sets) (different lengths)', function() {\r\n\t\tconst matcher = new PatternMatcher('[123]|[5-8][2-8]')\r\n\r\n\t\texpect(matcher.match('0')).to.be.undefined\r\n\t})\r\n\r\n\tit('should match an or pattern (one-of sets and regular digits) (different lengths)', function() {\r\n\t\tconst matcher = new PatternMatcher('[2358][2-5]|4')\r\n\r\n\t\texpect(matcher.match('0')).to.be.undefined\r\n\r\n\t\tmatcher.match('2').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('21')).to.be.undefined\r\n\r\n\t\tmatcher.match('22').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('25').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('26')).to.be.undefined\r\n\r\n\t\texpect(matcher.match('222')).to.be.undefined\r\n\r\n\t\tmatcher.match('222', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('3').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('4').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('6')).to.be.undefined\r\n\t})\r\n\r\n\tit('should match an or pattern (one-of sets and regular digits mixed) (different lengths)', function() {\r\n\t\tconst matcher = new PatternMatcher('[2358]2|4')\r\n\r\n\t\texpect(matcher.match('0')).to.be.undefined\r\n\r\n\t\tmatcher.match('2').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('21')).to.be.undefined\r\n\r\n\t\tmatcher.match('22').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('222')).to.be.undefined\r\n\r\n\t\tmatcher.match('222', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('3').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('4').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('6')).to.be.undefined\r\n\t})\r\n\r\n\tit('should match an or pattern (one-of sets groups and regular digits mixed) (different lengths)', function() {\r\n\t\tconst matcher = new PatternMatcher('1(?:11|[2-9])')\r\n\r\n\t\tmatcher.match('1').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('10')).to.be.undefined\r\n\r\n\t\tmatcher.match('11').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('111').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('1111')).to.be.undefined\r\n\r\n\t\tmatcher.match('1111', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('12').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('122')).to.be.undefined\r\n\r\n\t\tmatcher.match('19').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('5')).to.be.undefined\r\n\t})\r\n\r\n\tit('should match nested or groups', function() {\r\n\t\tconst matcher = new PatternMatcher('1(?:2(?:3(?:4|5)|6)|7(?:8|9))0')\r\n\r\n\t\tmatcher.match('1').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('2')).to.be.undefined\r\n\r\n\t\texpect(matcher.match('11')).to.be.undefined\r\n\r\n\t\tmatcher.match('12').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('121')).to.be.undefined\r\n\r\n\t\tmatcher.match('123').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('1231')).to.be.undefined\r\n\r\n\t\tmatcher.match('1234').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('12340').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('123401')).to.be.undefined\r\n\r\n\t\tmatcher.match('123401', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('12350').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('12360')).to.be.undefined\r\n\r\n\t\tmatcher.match('1260').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('1270')).to.be.undefined\r\n\r\n\t\texpect(matcher.match('1770')).to.be.undefined\r\n\r\n\t\tmatcher.match('1780').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('1790').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('18')).to.be.undefined\r\n\t})\r\n\r\n\tit('should match complex patterns', function() {\r\n\t\tconst matcher = new PatternMatcher('(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]')\r\n\r\n\t\texpect(matcher.match('0')).to.be.undefined\r\n\r\n\t\tmatcher.match('3').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('31').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('32')).to.be.undefined\r\n\r\n\t\tmatcher.match('316').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('315')).to.be.undefined\r\n\r\n\t\tmatcher.match('4').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('46').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('47')).to.be.undefined\r\n\r\n\t\tmatcher.match('5').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('50')).to.be.undefined\r\n\r\n\t\tmatcher.match('51').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('6').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('64')).to.be.undefined\r\n\r\n\t\tmatcher.match('65').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('650').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('654')).to.be.undefined\r\n\r\n\t\tmatcher.match('69').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('8').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('9').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\t})\r\n})"],"mappings":"AAAA,OAAOA,cAAP,MAA2B,wCAA3B;AAEAC,QAAQ,CAAC,mCAAD,EAAsC,YAAW;EACxDC,EAAE,CAAC,wCAAD,EAA2C,YAAW;IACvDC,MAAM,CAAC;MAAA,OAAM,IAAIH,cAAJ,EAAN;IAAA,CAAD,CAAN,CAAmCI,EAAnC,UAA4C,qBAA5C;EACA,CAFC,CAAF;EAIAF,EAAE,CAAC,uCAAD,EAA0C,YAAW;IACtD,IAAMG,OAAO,GAAG,IAAIL,cAAJ,CAAmB,GAAnB,CAAhB;IACAG,MAAM,CAAC;MAAA,OAAME,OAAO,CAACC,KAAR,EAAN;IAAA,CAAD,CAAN,CAA8BF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AAmBG,MAAnB,CAA0BC,IAA1B,CAA+BC,KAA/B,CAAqC;MACpCL,KAAK,EAAE;IAD6B,CAArC;IAIAD,OAAO,CAACC,KAAR,CAAc,GAAd,EAAmBG,MAAnB,CAA0BC,IAA1B,CAA+BC,KAA/B,CAAqC;MACpCL,KAAK,EAAE;IAD6B,CAArC;EAGA,CApEC,CAAF;AAqEA,CAtnBO,CAAR"}
1
+ {"version":3,"file":"AsYouTypeFormatter.PatternMatcher.test.js","names":["PatternMatcher","describe","it","expect","to","matcher","match","be","undefined","should","deep","equal","allowOverflow","overflow","partialMatch"],"sources":["../source/AsYouTypeFormatter.PatternMatcher.test.js"],"sourcesContent":["import PatternMatcher from './AsYouTypeFormatter.PatternMatcher.js'\r\n\r\ndescribe('AsYouTypeFormatter.PatternMatcher', function() {\r\n\tit('should throw when no pattern is passed', function() {\r\n\t\texpect(() => new PatternMatcher()).to.throw('Pattern is required')\r\n\t})\r\n\r\n\tit('should throw when no string is passed', function() {\r\n\t\tconst matcher = new PatternMatcher('1')\r\n\t\texpect(() => matcher.match()).to.throw('String is required')\r\n\t})\r\n\r\n\tit('should throw on illegal characters', function() {\r\n\t\texpect(() => new PatternMatcher('4(5|6)7')).to.throw('Illegal characters')\r\n\t})\r\n\r\n\tit('should throw on an illegal ] operator', function() {\r\n\t\texpect(() => new PatternMatcher('4]7')).to.throw('\"]\" operator must be preceded by \"[\" operator')\r\n\t})\r\n\r\n\tit('should throw on an illegal - operator in a one-of set', function() {\r\n\t\texpect(() => new PatternMatcher('[-5]')).to.throw('Couldn\\'t parse a one-of set pattern: -5')\r\n\t})\r\n\r\n\tit('should throw on a non-finalized context', function() {\r\n\t\texpect(() => new PatternMatcher('4(?:5|7')).to.throw('Non-finalized contexts left when pattern parse ended')\r\n\t})\r\n\r\n\tit('should throw on an illegal (|) operator', function() {\r\n\t\texpect(() => new PatternMatcher('4(?:5|)7')).to.throw('No instructions found after \"|\" operator in an \"or\" group')\r\n\t})\r\n\r\n\tit('should throw on an illegal ) operator', function() {\r\n\t\texpect(() => new PatternMatcher('4[56)]7')).to.throw('\")\" operator must be preceded by \"(?:\" operator')\r\n\t})\r\n\r\n\tit('should throw on an illegal | operator', function() {\r\n\t\texpect(() => new PatternMatcher('4[5|6]7')).to.throw('operator can only be used inside \"or\" groups')\r\n\t})\r\n\r\n\tit('should match a one-digit pattern', function() {\r\n\t\tconst matcher = new PatternMatcher('4')\r\n\r\n\t\texpect(matcher.match('1')).to.be.undefined\r\n\r\n\t\tmatcher.match('4').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('44')).to.be.undefined\r\n\r\n\t\tmatcher.match('44', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\t})\r\n\r\n\tit('should match a two-digit pattern', function() {\r\n\t\tconst matcher = new PatternMatcher('44')\r\n\r\n\t\texpect(matcher.match('1')).to.be.undefined\r\n\r\n\t\tmatcher.match('4').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('44').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('444')).to.be.undefined\r\n\r\n\t\tmatcher.match('444', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('55')).to.be.undefined\r\n\t})\r\n\r\n\tit('should match a one-digit one-of set (single digit)', function() {\r\n\t\tconst matcher = new PatternMatcher('[4]')\r\n\r\n\t\texpect(matcher.match('1')).to.be.undefined\r\n\r\n\t\tmatcher.match('4').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('44')).to.be.undefined\r\n\r\n\t\tmatcher.match('44', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\t})\r\n\r\n\tit('should match a one-digit one-of set (multiple digits)', function() {\r\n\t\tconst matcher = new PatternMatcher('[479]')\r\n\r\n\t\texpect(matcher.match('1')).to.be.undefined\r\n\r\n\t\tmatcher.match('4').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('44')).to.be.undefined\r\n\r\n\t\tmatcher.match('44', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\t})\r\n\r\n\tit('should match a one-digit one-of set using a dash notation (not inclusive)', function() {\r\n\t\tconst matcher = new PatternMatcher('[2-5]')\r\n\r\n\t\texpect(matcher.match('1')).to.be.undefined\r\n\r\n\t\tmatcher.match('4').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('44')).to.be.undefined\r\n\r\n\t\tmatcher.match('44', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\t})\r\n\r\n\tit('should match a one-digit one-of set using a dash notation (inclusive)', function() {\r\n\t\tconst matcher = new PatternMatcher('[3-4]')\r\n\r\n\t\texpect(matcher.match('1')).to.be.undefined\r\n\r\n\t\tmatcher.match('4').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('44')).to.be.undefined\r\n\r\n\t\tmatcher.match('44', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\t})\r\n\r\n\tit('should match a one-digit one-of set including a dash notation', function() {\r\n\t\tconst matcher = new PatternMatcher('[124-68]')\r\n\r\n\t\texpect(matcher.match('0')).to.be.undefined\r\n\r\n\t\tmatcher.match('1').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('2').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('3')).to.be.undefined\r\n\r\n\t\tmatcher.match('4').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('5').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('6').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('7')).to.be.undefined\r\n\r\n\t\tmatcher.match('8').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('9')).to.be.undefined\r\n\r\n\t\texpect(matcher.match('88')).to.be.undefined\r\n\r\n\t\tmatcher.match('88', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\t})\r\n\r\n\tit('should match a two-digit one-of set', function() {\r\n\t\tconst matcher = new PatternMatcher('[479][45]')\r\n\r\n\t\texpect(matcher.match('1')).to.be.undefined\r\n\r\n\t\tmatcher.match('4').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('5')).to.be.undefined\r\n\t\texpect(matcher.match('55')).to.be.undefined\r\n\r\n\t\tmatcher.match('44').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('444')).to.be.undefined\r\n\r\n\t\tmatcher.match('444', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\t})\r\n\r\n\tit('should match a two-digit one-of set (regular digit and a one-of set)', function() {\r\n\t\tconst matcher = new PatternMatcher('1[45]')\r\n\r\n\t\texpect(matcher.match('0')).to.be.undefined\r\n\r\n\t\tmatcher.match('1').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('15').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('16')).to.be.undefined\r\n\t})\r\n\r\n\tit('should match a pattern with an or group', function() {\r\n\t\tconst matcher = new PatternMatcher('7(?:1[0-68]|2[1-9])')\r\n\r\n\t\texpect(matcher.match('1')).to.be.undefined\r\n\r\n\t\tmatcher.match('7').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('71').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('73')).to.be.undefined\r\n\r\n\t\tmatcher.match('711').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('717')).to.be.undefined\r\n\r\n\t\texpect(matcher.match('720')).to.be.undefined\r\n\r\n\t\tmatcher.match('722').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('7222')).to.be.undefined\r\n\r\n\t\tmatcher.match('7222', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\t})\r\n\r\n\tit('should match an or pattern containing or groups', function() {\r\n\t\tconst matcher = new PatternMatcher('2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])')\r\n\r\n\t\texpect(matcher.match('1')).to.be.undefined\r\n\r\n\t\tmatcher.match('2').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('3').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('4')).to.be.undefined\r\n\r\n\t\texpect(matcher.match('21')).to.be.undefined\r\n\r\n\t\tmatcher.match('22').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('221')).to.be.undefined\r\n\r\n\t\tmatcher.match('222').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('2222')).to.be.undefined\r\n\r\n\t\tmatcher.match('2222', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('3').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('33').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('332').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('333')).to.be.undefined\r\n\t})\r\n\r\n\tit('should match an or pattern', function() {\r\n\t\tconst matcher = new PatternMatcher('6|8')\r\n\r\n\t\texpect(matcher.match('5')).to.be.undefined\r\n\r\n\t\tmatcher.match('6').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('7')).to.be.undefined\r\n\r\n\t\tmatcher.match('8').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\t})\r\n\r\n\tit('should match an or pattern (one-of sets)', function() {\r\n\t\tconst matcher = new PatternMatcher('[123]|[5-8]')\r\n\r\n\t\texpect(matcher.match('0')).to.be.undefined\r\n\r\n\t\tmatcher.match('1').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('2').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('3').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('4')).to.be.undefined\r\n\r\n\t\tmatcher.match('5').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('6').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('7').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('8').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('9')).to.be.undefined\r\n\r\n\t\texpect(matcher.match('18')).to.be.undefined\r\n\r\n\t\tmatcher.match('18', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\t})\r\n\r\n\tit('should match an or pattern (different lengths)', function() {\r\n\t\tconst matcher = new PatternMatcher('60|8')\r\n\r\n\t\texpect(matcher.match('5')).to.be.undefined\r\n\r\n\t\tmatcher.match('6').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('60').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('61')).to.be.undefined\r\n\r\n\t\texpect(matcher.match('7')).to.be.undefined\r\n\r\n\t\tmatcher.match('8').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('68')).to.be.undefined\r\n\t})\r\n\r\n\tit('should match an or pattern (one-of sets) (different lengths)', function() {\r\n\t\tconst matcher = new PatternMatcher('[123]|[5-8][2-8]')\r\n\r\n\t\texpect(matcher.match('0')).to.be.undefined\r\n\t})\r\n\r\n\tit('should match an or pattern (one-of sets and regular digits) (different lengths)', function() {\r\n\t\tconst matcher = new PatternMatcher('[2358][2-5]|4')\r\n\r\n\t\texpect(matcher.match('0')).to.be.undefined\r\n\r\n\t\tmatcher.match('2').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('21')).to.be.undefined\r\n\r\n\t\tmatcher.match('22').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('25').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('26')).to.be.undefined\r\n\r\n\t\texpect(matcher.match('222')).to.be.undefined\r\n\r\n\t\tmatcher.match('222', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('3').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('4').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('6')).to.be.undefined\r\n\t})\r\n\r\n\tit('should match an or pattern (one-of sets and regular digits mixed) (different lengths)', function() {\r\n\t\tconst matcher = new PatternMatcher('[2358]2|4')\r\n\r\n\t\texpect(matcher.match('0')).to.be.undefined\r\n\r\n\t\tmatcher.match('2').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('21')).to.be.undefined\r\n\r\n\t\tmatcher.match('22').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('222')).to.be.undefined\r\n\r\n\t\tmatcher.match('222', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('3').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('4').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('6')).to.be.undefined\r\n\t})\r\n\r\n\tit('should match an or pattern (one-of sets groups and regular digits mixed) (different lengths)', function() {\r\n\t\tconst matcher = new PatternMatcher('1(?:11|[2-9])')\r\n\r\n\t\tmatcher.match('1').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('10')).to.be.undefined\r\n\r\n\t\tmatcher.match('11').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('111').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('1111')).to.be.undefined\r\n\r\n\t\tmatcher.match('1111', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('12').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('122')).to.be.undefined\r\n\r\n\t\tmatcher.match('19').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('5')).to.be.undefined\r\n\t})\r\n\r\n\tit('should match nested or groups', function() {\r\n\t\tconst matcher = new PatternMatcher('1(?:2(?:3(?:4|5)|6)|7(?:8|9))0')\r\n\r\n\t\tmatcher.match('1').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('2')).to.be.undefined\r\n\r\n\t\texpect(matcher.match('11')).to.be.undefined\r\n\r\n\t\tmatcher.match('12').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('121')).to.be.undefined\r\n\r\n\t\tmatcher.match('123').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('1231')).to.be.undefined\r\n\r\n\t\tmatcher.match('1234').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('12340').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('123401')).to.be.undefined\r\n\r\n\t\tmatcher.match('123401', { allowOverflow: true }).should.deep.equal({\r\n\t\t\toverflow: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('12350').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('12360')).to.be.undefined\r\n\r\n\t\tmatcher.match('1260').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('1270')).to.be.undefined\r\n\r\n\t\texpect(matcher.match('1770')).to.be.undefined\r\n\r\n\t\tmatcher.match('1780').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('1790').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('18')).to.be.undefined\r\n\t})\r\n\r\n\tit('should match complex patterns', function() {\r\n\t\tconst matcher = new PatternMatcher('(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]')\r\n\r\n\t\texpect(matcher.match('0')).to.be.undefined\r\n\r\n\t\tmatcher.match('3').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('31').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('32')).to.be.undefined\r\n\r\n\t\tmatcher.match('316').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('315')).to.be.undefined\r\n\r\n\t\tmatcher.match('4').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('46').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('47')).to.be.undefined\r\n\r\n\t\tmatcher.match('5').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('50')).to.be.undefined\r\n\r\n\t\tmatcher.match('51').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('6').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('64')).to.be.undefined\r\n\r\n\t\tmatcher.match('65').should.deep.equal({\r\n\t\t\tpartialMatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('650').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\texpect(matcher.match('654')).to.be.undefined\r\n\r\n\t\tmatcher.match('69').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('8').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\r\n\t\tmatcher.match('9').should.deep.equal({\r\n\t\t\tmatch: true\r\n\t\t})\r\n\t})\r\n\r\n\tit('shouldn\\'t match things that shouldn\\'t match', function() {\r\n\t\t// There was a bug: \"leading digits\" `\"2\"` matched \"leading digits pattern\" `\"90\"`.\r\n\t\t// The incorrect `.match()` function result was `{ oveflow: true }`\r\n\t\t// while it should've been `undefined`.\r\n\t\t// https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/66\r\n\t\texpect(new PatternMatcher('2').match('90', { allowOverflow: true })).to.be.undefined\r\n\t})\r\n})"],"mappings":"AAAA,OAAOA,cAAP,MAA2B,wCAA3B;AAEAC,QAAQ,CAAC,mCAAD,EAAsC,YAAW;EACxDC,EAAE,CAAC,wCAAD,EAA2C,YAAW;IACvDC,MAAM,CAAC;MAAA,OAAM,IAAIH,cAAJ,EAAN;IAAA,CAAD,CAAN,CAAmCI,EAAnC,UAA4C,qBAA5C;EACA,CAFC,CAAF;EAIAF,EAAE,CAAC,uCAAD,EAA0C,YAAW;IACtD,IAAMG,OAAO,GAAG,IAAIL,cAAJ,CAAmB,GAAnB,CAAhB;IACAG,MAAM,CAAC;MAAA,OAAME,OAAO,CAACC,KAAR,EAAN;IAAA,CAAD,CAAN,CAA8BF,EAA9B,UAAuC,oBAAvC;EACA,CAHC,CAAF;EAKAF,EAAE,CAAC,oCAAD,EAAuC,YAAW;IACnDC,MAAM,CAAC;MAAA,OAAM,IAAIH,cAAJ,CAAmB,SAAnB,CAAN;IAAA,CAAD,CAAN,CAA4CI,EAA5C,UAAqD,oBAArD;EACA,CAFC,CAAF;EAIAF,EAAE,CAAC,uCAAD,EAA0C,YAAW;IACtDC,MAAM,CAAC;MAAA,OAAM,IAAIH,cAAJ,CAAmB,KAAnB,CAAN;IAAA,CAAD,CAAN,CAAwCI,EAAxC,UAAiD,+CAAjD;EACA,CAFC,CAAF;EAIAF,EAAE,CAAC,uDAAD,EAA0D,YAAW;IACtEC,MAAM,CAAC;MAAA,OAAM,IAAIH,cAAJ,CAAmB,MAAnB,CAAN;IAAA,CAAD,CAAN,CAAyCI,EAAzC,UAAkD,0CAAlD;EACA,CAFC,CAAF;EAIAF,EAAE,CAAC,yCAAD,EAA4C,YAAW;IACxDC,MAAM,CAAC;MAAA,OAAM,IAAIH,cAAJ,CAAmB,SAAnB,CAAN;IAAA,CAAD,CAAN,CAA4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