regexpu-core
Advanced tools
Comparing version 4.5.5 to 4.6.0
{ | ||
"name": "regexpu-core", | ||
"version": "4.5.5", | ||
"version": "4.6.0", | ||
"description": "regexpu’s core functionality (i.e. `rewritePattern(pattern, flag)`), capable of translating ES6 Unicode regular expressions to ES5.", | ||
@@ -64,5 +64,5 @@ "homepage": "https://mths.be/regexpu", | ||
"mocha": "^6.2.0", | ||
"regexpu-fixtures": "^2.1.2", | ||
"regexpu-fixtures": "^2.1.3", | ||
"unicode-12.1.0": "^0.8.0" | ||
} | ||
} |
@@ -28,6 +28,2 @@ 'use strict'; | ||
); | ||
// Prepare a Regenerate set containing all code points that are supposed to be | ||
// matched by `/./` (only BMP code points). | ||
const DOT_SET = DOT_SET_UNICODE.clone() | ||
.intersection(BMP_SET); | ||
@@ -44,7 +40,4 @@ const getCharacterClassEscapeSet = (character, unicode, ignoreCase) => { | ||
const getDotSet = (unicode, dotAll) => { | ||
if (dotAll) { | ||
return unicode ? UNICODE_SET : BMP_SET; | ||
} | ||
return unicode ? DOT_SET_UNICODE : DOT_SET; | ||
const getUnicodeDotSet = (dotAll) => { | ||
return dotAll ? UNICODE_SET : DOT_SET_UNICODE; | ||
}; | ||
@@ -200,6 +193,11 @@ | ||
case 'dot': | ||
update( | ||
item, | ||
getDotSet(config.unicode, config.dotAll).toString(regenerateOptions) | ||
); | ||
if (config.unicode) { | ||
update( | ||
item, | ||
getUnicodeDotSet(config.dotAll).toString(regenerateOptions) | ||
); | ||
} else if (config.dotAll) { | ||
// TODO: consider changing this at the regenerate level. | ||
update(item, '[\\s\\S]'); | ||
} | ||
break; | ||
@@ -227,3 +225,5 @@ case 'characterClass': | ||
case 'group': | ||
groups.lastIndex++; | ||
if (item.behavior == 'normal') { | ||
groups.lastIndex++; | ||
} | ||
if (item.name) { | ||
@@ -230,0 +230,0 @@ const name = item.name.value; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37502