fix: use named import for node-emoji

This commit is contained in:
Ross Shannon 2026-01-30 00:10:25 +00:00
parent 6f36fbfc76
commit 99e35bdf49

View File

@ -1,5 +1,5 @@
import type { WebClient } from "@slack/web-api"; import type { WebClient } from "@slack/web-api";
import emoji from "node-emoji"; import { which as emojiWhich } from "node-emoji";
import { loadConfig } from "../config/config.js"; import { loadConfig } from "../config/config.js";
import { logVerbose } from "../globals.js"; import { logVerbose } from "../globals.js";
@ -58,13 +58,13 @@ function normalizeEmoji(raw: string) {
if (!trimmed) { if (!trimmed) {
throw new Error("Emoji is required for Slack reactions"); throw new Error("Emoji is required for Slack reactions");
} }
// Try Unicode → shortcode conversion first // Try Unicode → shortcode conversion first
const shortcode = emoji.which(trimmed); const shortcode = emojiWhich(trimmed);
if (shortcode) { if (shortcode) {
return shortcode; return shortcode;
} }
// Fall back to stripping colons (for already-formatted shortcodes) // Fall back to stripping colons (for already-formatted shortcodes)
return trimmed.replace(/^:+|:+$/g, ""); return trimmed.replace(/^:+|:+$/g, "");
} }