Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict';
const scriptAliases = require('unicode-property-value-aliases').get('Script');
const utils = require('./utils.js');
const findCanonicalName = function(shortName) {
return scriptAliases.get(shortName);
};
const parseScriptExtensions = function(version, scriptsMap) {
// Old Unicode versions lack scripts data. Return early in such cases.
if (!scriptsMap) {
return;
}
// Turn the array of code points for each script into a set, so we can more
// easily add/remove from them.
const knownScriptNames = Object.keys(scriptsMap);
for (const script of knownScriptNames) {
scriptsMap[script] = new Set(scriptsMap[script]);
'use strict';
const aliases = require('unicode-property-value-aliases').get('Line_Break');
const utils = require('./utils.js');
const findCanonicalName = function(shortName) {
return aliases.get(shortName);
};
const handled = new Set();
const parseLineBreak = function(version) {
const source = utils.readDataFile(version, 'line-break');
if (!source) {
return;
}
const map = {};
const lines = source.split('\n');
lines.forEach(function(line) {
'use strict';
const utils = require('./utils.js');
const valueAliases = require('unicode-property-value-aliases');
const bidiAliases = valueAliases.get('Bidi_Class');
const categoryAliases = valueAliases.get('General_Category');
const parseDatabase = function(version) {
const symbolMap = new Map();
const bidiMap = new Map();
const bidiMirrored = new Set();
const source = utils.readDataFile(version, 'database');
if (!source) {
return;
}
const lines = source.split('\n');
let flag = false;
let first = 0;
lines.forEach(function(line) {
const data = line.trim().split(';');
const codePoint = parseInt(data[0], 16);
'use strict';
const utils = require('./utils.js');
const valueAliases = require('unicode-property-value-aliases');
const bidiAliases = valueAliases.get('Bidi_Class');
const categoryAliases = valueAliases.get('General_Category');
const parseDatabase = function(version) {
const symbolMap = new Map();
const bidiMap = new Map();
const bidiMirrored = new Set();
const source = utils.readDataFile(version, 'database');
if (!source) {
return;
}
const lines = source.split('\n');
let flag = false;
let first = 0;
lines.forEach(function(line) {
const data = line.trim().split(';');
const codePoint = parseInt(data[0], 16);
const name = data[1];