UNPKG

@lobehub/fluent-emoji

Version:

Fluent Emoji are a collection of familiar, friendly, and modern emoji from Microsoft

14 lines (13 loc) 617 B
import { genEmojiUrl } from "./utils.mjs"; import urlJoin from "url-join"; //#region src/getFluentEmojiCDN/index.tsx const ALIYUN_ICON_CDN = ({ pkg, path }) => urlJoin("https://registry.npmmirror.com", pkg, "latest/files", path); const UNPKG_ICON_CDN = ({ pkg, path }) => urlJoin("https://unpkg.com", `${pkg}@latest`, path); const getFluentEmojiCDN = (id, config) => { const { type = "3d", cdn = "aliyun" } = config || {}; const emoji = genEmojiUrl(id, type); return cdn === "unpkg" ? UNPKG_ICON_CDN(emoji) : ALIYUN_ICON_CDN(emoji); }; //#endregion export { getFluentEmojiCDN }; //# sourceMappingURL=index.mjs.map