Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
return { matched: characters.length > 0, data: characters.join('') };
};
// excluding nonbinary properties from mathias' list
// https://www.ecma-international.org/ecma-262/9.0/index.html#table-nonbinary-unicode-properties
const illegalLoneUnicodePropertyNames = [
'General_Category',
'Script',
'Script_Extensions',
'scx',
'sc',
'gc',
];
const generalCategoryValues = matchPropertyValueMappings.get('General_Category');
const acceptLoneUnicodePropertyNameOrValue = state => {
let loneValue = acceptUnicodePropertyValue(state);
if (!loneValue.matched || illegalLoneUnicodePropertyNames.includes(loneValue.data)) {
return { matched: false };
}
return { matched: catchIsFalse(() => matchProperty(loneValue.data)) || generalCategoryValues.get(loneValue.data) != null };
};
const acceptUnicodePropertyValueExpression = state =>
anyOf(backtrackOnFailure(subState => {
let name = acceptUnicodePropertyName(subState);
if (!name.matched || !subState.eat('=')) {
return { matched: false };
}
return { matched: catchIsFalse(() => matchPropertyValue(propertyAliases.get(name.data) || name.data, value.data)) };
}),