Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
xml('annotation').each((i, rawRow) => {
const row = xml(rawRow);
// Variation selectors are not present in the locale files
// So lets just strip unnecessary codepoints
const hexcode = stripHexcode(fromUnicodeToHexcode(row.attr('cp')));
if (!data[hexcode]) {
data[hexcode] = {
annotation: '',
tags: new Set(),
};
}
if (row.attr('type') === 'tts') {
data[hexcode].annotation = row.text().trim();
} else {
data[hexcode].tags = new Set(
row
.text()
.trim()
.split('|')
xml('annotation').each((i, rawRow) => {
const row = xml(rawRow);
// Variation selectors are not present in the locale files
// So lets just strip unnecessary codepoints
const hexcode = stripHexcode(fromUnicodeToHexcode(row.attr('cp')!));
if (!data[hexcode]) {
data[hexcode] = {
annotation: '',
tags: [],
};
}
if (row.attr('type') === 'tts') {
data[hexcode].annotation = row.text().trim();
} else {
data[hexcode].tags = row
.text()
.trim()
.split('|')
.map(tag => tag.trim().toLowerCase());