@fibery/emoji-data
Advanced tools
Comparing version 2.3.0 to 2.4.0
@@ -10,3 +10,3 @@ "use strict"; | ||
let initialized = false; | ||
let emojis = {}; | ||
const emojis = {}; | ||
let rawEmojis = {}; | ||
@@ -83,24 +83,17 @@ let aliases = {}; | ||
const removeCustomEmojiFromDB = (emoji) => { | ||
const { [emoji.id]: deleted, ...rest } = emojis; | ||
emojis = rest; | ||
delete emojis[emoji.id]; | ||
if (!emoji.hidden) { | ||
const nextAliases = { ...aliases }; | ||
for (const shortName of emoji.shortNames) { | ||
delete nextAliases[shortName]; | ||
delete aliases[shortName]; | ||
} | ||
aliases = nextAliases; | ||
} | ||
removeCustomEmojiFromLookups(deleted); | ||
removeCustomEmojiFromLookups(emoji); | ||
}; | ||
const addCustomEmojiToDBs = (emoji) => { | ||
addCustomEmojiToLookups(emoji); | ||
emojis = { | ||
...emojis, | ||
[emoji.id]: emoji, | ||
}; | ||
emojis[emoji.id] = emoji; | ||
if (!emoji.hidden) { | ||
aliases = { | ||
...aliases, | ||
...Object.fromEntries(emoji.shortNames.map((shortName) => [shortName, emoji.id])), | ||
}; | ||
for (const shortName of emoji.shortNames) { | ||
aliases[shortName] = emoji.id; | ||
} | ||
} | ||
@@ -107,0 +100,0 @@ return emoji; |
{ | ||
"name": "@fibery/emoji-data", | ||
"version": "2.3.0", | ||
"version": "2.4.0", | ||
"description": "Emoji dataset used in Fibery", | ||
@@ -37,4 +37,4 @@ "license": "UNLICENSED", | ||
"typescript": "5.1.6", | ||
"@fibery/babel-preset": "7.3.0", | ||
"@fibery/eslint-config": "8.5.0" | ||
"@fibery/babel-preset": "7.4.0", | ||
"@fibery/eslint-config": "8.5.1" | ||
}, | ||
@@ -41,0 +41,0 @@ "jest": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
801212
28604