Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
set = handleLoneUnicodePropertyNameOrValue(firstPart);
} else {
// The pattern consists of two parts, i.e. `Property=Value`.
const property = unicodeMatchProperty(firstPart);
const value = unicodeMatchPropertyValue(property, parts[1]);
set = getUnicodePropertyValueSet(property, value);
}
if (isNegative) {
return UNICODE_SET.clone().remove(set);
}
return set.clone();
};
// Given a range of code points, add any case-folded code points in that range
// to a set.
regenerate.prototype.iuAddRange = function(min, max) {
const $this = this;
do {
const folded = caseFold(min);
if (folded) {
$this.add(folded);
}
} while (++min <= max);
return $this;
};
const update = (item, pattern) => {
let tree = parse(pattern, config.useUnicodeFlag ? 'u' : '');
switch (tree.type) {
case 'characterClass':
case 'group':
case 'value':
const fs = require('fs');
const jsesc = require('jsesc');
const emptyDirSync = require('fs-extra').emptyDirSync;
const regenerate = require('regenerate');
const UNICODE_VERSION = '12.1.0';
const unicode = require(`unicode-${ UNICODE_VERSION }`);
/*----------------------------------------------------------------------------*/
const codePointToString = function(codePoint) {
return '0x' + codePoint.toString(16).toUpperCase();
};
// Regenerate plugin that turns a set into some JavaScript source code that
// generates that set.
regenerate.prototype.toCode = function() {
const data = this.data;
// Iterate over the data per `(start, end)` pair.
let index = 0;
let start;
let end;
const length = data.length;
const loneCodePoints = [];
const ranges = [];
while (index < length) {
start = data[index];
end = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive.
if (start == end) {
loneCodePoints.push(codePointToString(start));
} else {
ranges.push(
'addRange(' + codePointToString(start) +
)
);
addCharacterClassEscape(
'w', // `\w` and `\W`
regenerate('_').addRange('a', 'z').addRange('A', 'Z').addRange('0', '9')
);
/*----------------------------------------------------------------------------*/
function codePointToString(codePoint) {
return '0x' + codePoint.toString(16).toUpperCase();
}
// Regenerate plugin that turns a set into some JavaScript source code that
// generates that set.
regenerate.prototype.toCode = function() {
var data = this.data;
// Iterate over the data per `(start, end)` pair.
var index = 0;
var start;
var end;
var length = data.length;
var loneCodePoints = [];
var ranges = [];
while (index < length) {
start = data[index];
end = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive.
if (start == end) {
loneCodePoints.push(codePointToString(start));
} else {
ranges.push(
'addRange(' + codePointToString(start) +
set = handleLoneUnicodePropertyNameOrValue(firstPart);
} else {
// The pattern consists of two parts, i.e. `Property=Value`.
const property = unicodeMatchProperty(firstPart);
const value = unicodeMatchPropertyValue(property, parts[1]);
set = getUnicodePropertyValueSet(property, value);
}
if (isNegative) {
return UNICODE_SET.clone().remove(set);
}
return set.clone();
};
// Given a range of code points, add any case-folded code points in that range
// to a set.
regenerate.prototype.iuAddRange = function(min, max) {
const $this = this;
do {
const folded = caseFold(min);
if (folded) {
$this.add(folded);
}
} while (++min <= max);
return $this;
};
const update = (item, pattern) => {
let tree = parse(pattern, config.useUnicodeFlag ? 'u' : '');
switch (tree.type) {
case 'characterClass':
case 'group':
case 'value':
)
);
addCharacterClassEscape(
'w', // `\w` and `\W`
regenerate('_').addRange('a', 'z').addRange('A', 'Z').addRange('0', '9')
);
/*----------------------------------------------------------------------------*/
const codePointToString = (codePoint) => {
return '0x' + codePoint.toString(16).toUpperCase();
};
// Regenerate plugin that turns a set into some JavaScript source code that
// generates that set.
regenerate.prototype.toCode = function() {
const data = this.data;
// Iterate over the data per `(start, end)` pair.
let index = 0;
let start;
let end;
const length = data.length;
const loneCodePoints = [];
const ranges = [];
while (index < length) {
start = data[index];
end = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive.
if (start == end) {
loneCodePoints.push(codePointToString(start));
} else {
ranges.push(
'addRange(' + codePointToString(start) +
set = handleLoneUnicodePropertyNameOrValue(firstPart);
} else {
// The pattern consists of two parts, i.e. `Property=Value`.
const property = unicodeMatchProperty(firstPart);
const value = unicodeMatchPropertyValue(property, parts[1]);
set = getUnicodePropertyValueSet(property, value);
}
if (isNegative) {
return UNICODE_SET.clone().remove(set);
}
return set.clone();
};
// Given a range of code points, add any case-folded code points in that range
// to a set.
regenerate.prototype.iuAddRange = function(min, max) {
const $this = this;
do {
const folded = caseFold(min);
if (folded) {
$this.add(folded);
}
} while (++min <= max);
return $this;
};
const update = (item, pattern) => {
let tree = parse(pattern, config.useUnicodeFlag ? 'u' : '');
switch (tree.type) {
case 'characterClass':
case 'group':
case 'value':
var DOT_SET_UNICODE = UNICODE_SET.clone() // all Unicode code points
.remove(
// minus `LineTerminator`s (https://mths.be/es6#sec-line-terminators):
0x000A, // Line Feed
0x000D, // Carriage Return
0x2028, // Line Separator
0x2029 // Paragraph Separator
);
// Prepare a Regenerate set containing all code points that are supposed to be
// matched by `/./` (only BMP code points).
var DOT_SET = DOT_SET_UNICODE.clone()
.intersection(BMP_SET);
// Add a range of code points + any case-folded code points in that range to a
// set.
regenerate.prototype.iuAddRange = function(min, max) {
var $this = this;
do {
var folded = caseFold(min);
if (folded) {
$this.add(folded);
}
} while (++min <= max);
return $this;
};
function assign(target, source) {
for (var key in source) {
// Note: `hasOwnProperty` is not needed here.
target[key] = source[key];
}
}
var DOT_SET_UNICODE = UNICODE_SET.clone() // all Unicode code points
.remove(
// minus `LineTerminator`s (https://mths.be/es6#sec-line-terminators):
0x000A, // Line Feed
0x000D, // Carriage Return
0x2028, // Line Separator
0x2029 // Paragraph Separator
);
// Prepare a Regenerate set containing all code points that are supposed to be
// matched by `/./` (only BMP code points).
var DOT_SET = DOT_SET_UNICODE.clone()
.intersection(BMP_SET);
// Add a range of code points + any case-folded code points in that range to a
// set.
regenerate.prototype.iuAddRange = function (min, max) {
var $this = this;
do {
var folded = caseFold(min);
if (folded) {
$this.add(folded);
}
} while (++min <= max);
return $this;
};
function assign(target, source) {
for (var key in source) {
// Note: `hasOwnProperty` is not needed here.
target[key] = source[key];
}
}