How to use the emojibase-data/en/data.json.length function in emojibase-data

To help you get started, we’ve selected a few emojibase-data 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 idleberg / vscode-emoji-code / src / build.js View on Github external
const writeSnippets = (type, prefix = '', suffix = '') => {

    for (let i = 0; i < emojiAll.length; i++) {
        let emoji, json, name, output, unicode;

        if (typeof emojiAll[i].name != 'undefined' && emojiAll[i].name !== null ) {
            name = emojiAll[i].name.toLowerCase().replace(/[\s,\.]+/g, '-');
        } else {
            name = emojiAll[i].short_name;
        }

        unicodes = emojiAll[i].hexcode.split('-');

        unicodes.forEach(function(unicode, index) {
          if (type === 'python') {
            unicode = String('0000000' + unicode).slice(-8);
          } else if (type === 'csharp') {
            unicode = findSurrogatePair(parseInt(unicode, 16)).join('\\u');
          }