How to use the emojibase.fromUnicodeToHexcode function in emojibase

To help you get started, we’ve selected a few emojibase examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github milesj / emojibase / packages / generator / src / parsers / parseAnnotations.ts View on Github external
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('|')
github milesj / emojibase / packages / generator / src / parsers / parseAnnotations.ts View on Github external
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());