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 path = require("path");
const alfy = require("alfy");
const search = require("@jukben/emoji-search").default;
const unicode = require("@jukben/unicode").default;
const emojis = require("emoji-datasource-apple");
const ALWAYS_OFFLINE = +process.env["always-offline"] || 0;
const emojiLookup = emojis.reduce((a, v, i, arr) => {
a[v.unified.toLowerCase()] = v;
if (v.non_qualified) {
a[v.non_qualified.toLowerCase()] = v;
}
return a;
}, {});
const getHex = char => unicode(char).hexCodeAt(0);
function getImagePath(char) {
return `${path.dirname(require.resolve("emoji-datasource-apple"))}/img/apple/64/${emojiLookup[getHex(char)].image}`;
}
function getName(char) {