UNPKG

@nodesecure/flags

Version:
32 lines 843 B
// Import Internal Dependencies import { FLAGS } from "./manifest.js"; // CONSTANTS const kNotFoundFlags = "🔴"; const kManifestEmoji = Object.fromEntries(getManifestEmoji()); /** * @description Export src/manifest.json */ export function getManifest() { return structuredClone(FLAGS); } /** * @example * const kManifestEmoji = Object.fromEntries(getManifestEmoji()); */ export function* getManifestEmoji() { for (const { title, emoji } of Object.values(FLAGS)) { yield [title, emoji]; } } export function getEmojiFromTitle(title) { return kManifestEmoji[title] ?? kNotFoundFlags; } /** * @description Complete list of flags title (as an ES6 Set) */ export function getFlags() { return new Set(Object .values(FLAGS) .map((descriptor) => descriptor.title)); } //# sourceMappingURL=web.js.map