How to use the emojibase-data/en/compact.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 kevinfaguiar / cool-emoji-picker / utils / remove-unused.js View on Github external
let compact = require('emojibase-data/en/compact.json');
let groupMetaData = require('emojibase-data/meta/groups.json');
const fs = require('fs');

const emojiArray = [];

for (let i = 0; i < compact.length; i++) {
  let emojiGroupFound = emojiArray.find(emojiGroup => emojiGroup.group === compact[i].group);
  let emojiGroup = {};

  if (emojiGroupFound !== undefined) {
    emojiGroup = emojiGroupFound;
  } else {
    emojiGroup = { group: compact[i].group, emojiList: [] };
  }

  let emojiObj = { unicode: compact[i].unicode, /* tags: compact[i].tags */ };
  if (compact[i].skins !== undefined) {
    emojiObj.skins = [];
    for (let j = 0; j < compact[i].skins.length; j++) {
      emojiObj.skins.push({ 
        unicode: compact[i].skins[j].unicode, 
        /* tags: compact[i].skins[j].tags */