{"version":3,"file":"normalize-icon-name.cjs","names":[],"sources":["../../src/icons/normalize-icon-name.ts"],"sourcesContent":["import { resolveIconAlias } from \"./alias\";\n\n/**\n * Clean up an icon code and resolve it to the slug lucide actually ships.\n *\n * Every backend that stores an `icon_code` stores it dirty: `snake_case` left over\n * from an old form, a capital or a stray space from a hand-typed value, and slugs\n * lucide has since deprecated. Each app was writing the same three-step cleanup\n * before rendering — trim, lower-case, `_` → `-`, then `resolveIconAlias` — which\n * is code that should not exist outside the SDK.\n *\n * Note that this does **not** check whether the result is a real icon: the point is\n * to produce the canonical spelling, and deciding what to do with an unknown name\n * belongs to the caller. Pair it with `isIconName` when you need that answer, or\n * let `<Icon>` render its `fallback`.\n *\n * @example\n * normalizeIconName(\"  Alert_Circle \");  // \"circle-alert\"\n * normalizeIconName(\"shopping_cart\");    // \"shopping-cart\"\n *\n * @param code - Any stored icon code.\n * @returns The canonical, lucide-spelled slug.\n */\nexport function normalizeIconName(code: string): string {\n    return resolveIconAlias(code.trim().toLowerCase().replaceAll(\"_\", \"-\"));\n}\n"],"mappings":"+BAuBA,SAAgB,EAAkB,EAAsB,CACpD,OAAO,EAAA,iBAAiB,EAAK,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,WAAW,IAAK,GAAG,CAAC,CAC1E"}