regexpu-core
Advanced tools
Comparing version 4.0.2 to 4.0.3
{ | ||
"name": "regexpu-core", | ||
"version": "4.0.2", | ||
"version": "4.0.3", | ||
"description": "regexpu’s core functionality (i.e. `rewritePattern(pattern, flag)`), capable of translating ES6 Unicode regular expressions to ES5.", | ||
@@ -51,6 +51,6 @@ "homepage": "https://mths.be/regexpu", | ||
"dependencies": { | ||
"regenerate": "^1.3.1", | ||
"regenerate-unicode-properties": "^4.0.2", | ||
"regenerate": "^1.3.2", | ||
"regenerate-unicode-properties": "^4.0.3", | ||
"regjsgen": "^0.3.0", | ||
"regjsparser": "^0.2.0", | ||
"regjsparser": "^0.2.1", | ||
"unicode-match-property": "^0.1.2", | ||
@@ -61,10 +61,10 @@ "unicode-match-property-value": "^1.0.2" | ||
"codecov": "^1.0.1", | ||
"istanbul": "^0.4.4", | ||
"jsesc": "^2.2.0", | ||
"lodash": "^4.15.0", | ||
"mocha": "^3.0.2", | ||
"istanbul": "^0.4.5", | ||
"jsesc": "^2.4.0", | ||
"lodash": "^4.17.4", | ||
"mocha": "^3.2.0", | ||
"regexpu-fixtures": "^2.1.1", | ||
"unicode-9.0.0": "^0.7.0", | ||
"unicode-tr51": "^7.0.2" | ||
"unicode-tr51": "^8.0.1" | ||
} | ||
} |
@@ -33,3 +33,3 @@ 'use strict'; | ||
const getCharacterClassEscapeSet = function(character, unicode, ignoreCase) { | ||
const getCharacterClassEscapeSet = (character, unicode, ignoreCase) => { | ||
if (unicode) { | ||
@@ -44,3 +44,3 @@ if (ignoreCase) { | ||
const getDotSet = function(unicode, dotAll) { | ||
const getDotSet = (unicode, dotAll) => { | ||
if (dotAll) { | ||
@@ -52,3 +52,3 @@ return unicode ? UNICODE_SET : BMP_SET; | ||
const getUnicodePropertyValueSet = function(property, value) { | ||
const getUnicodePropertyValueSet = (property, value) => { | ||
const path = value ? | ||
@@ -67,3 +67,3 @@ `${ property }/${ value }` : | ||
const handleLoneUnicodePropertyNameOrValue = function(value) { | ||
const handleLoneUnicodePropertyNameOrValue = (value) => { | ||
// It could be a `General_Category` value or a binary property. | ||
@@ -82,3 +82,3 @@ // Note: `unicodeMatchPropertyValue` throws on invalid values. | ||
const getUnicodePropertyEscapeSet = function(value, isNegative) { | ||
const getUnicodePropertyEscapeSet = (value, isNegative) => { | ||
const parts = value.split('='); | ||
@@ -114,3 +114,3 @@ const firstPart = parts[0]; | ||
const update = function(item, pattern) { | ||
const update = (item, pattern) => { | ||
let tree = parse(pattern, config.useUnicodeFlag ? 'u' : ''); | ||
@@ -130,3 +130,3 @@ switch (tree.type) { | ||
const wrap = function(tree, pattern) { | ||
const wrap = (tree, pattern) => { | ||
// Wrap the pattern in a non-capturing group. | ||
@@ -141,9 +141,9 @@ return { | ||
const caseFold = function(codePoint) { | ||
const caseFold = (codePoint) => { | ||
return iuMappings.get(codePoint) || false; | ||
}; | ||
const processCharacterClass = function(characterClassItem, regenerateOptions) { | ||
const processCharacterClass = (characterClassItem, regenerateOptions) => { | ||
let set = regenerate(); | ||
const body = characterClassItem.body.forEach(function(item) { | ||
for (const item of characterClassItem.body) { | ||
switch (item.type) { | ||
@@ -183,3 +183,3 @@ case 'value': | ||
} | ||
}); | ||
} | ||
if (characterClassItem.negative) { | ||
@@ -192,3 +192,3 @@ set = (config.unicode ? UNICODE_SET : BMP_SET).clone().remove(set); | ||
const processTerm = function(item, regenerateOptions) { | ||
const processTerm = (item, regenerateOptions) => { | ||
switch (item.type) { | ||
@@ -225,3 +225,3 @@ case 'dot': | ||
case 'quantifier': | ||
item.body = item.body.map(function(term) { | ||
item.body = item.body.map(term => { | ||
return processTerm(term, regenerateOptions); | ||
@@ -262,3 +262,3 @@ }); | ||
}; | ||
const rewritePattern = function(pattern, flags, options) { | ||
const rewritePattern = (pattern, flags, options) => { | ||
const regjsparserFeatures = { | ||
@@ -277,3 +277,4 @@ 'unicodePropertyEscape': options && options.unicodePropertyEscape | ||
const tree = parse(pattern, flags, regjsparserFeatures); | ||
Object.assign(tree, processTerm(tree, regenerateOptions)); | ||
// Note: `processTerm` mutates `tree`. | ||
processTerm(tree, regenerateOptions); | ||
return generate(tree); | ||
@@ -280,0 +281,0 @@ }; |
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
1095
31714
Updatedregenerate@^1.3.2
Updatedregjsparser@^0.2.1