···13151315 const lower = code.toLowerCase();
13161316 return ALCHEMY_YEAR_SETS[lower];
13171317}
13181318+13191319+// Build set of all individual alchemy set codes for fast lookup
13201320+const ALL_ALCHEMY_SETS = new Set(
13211321+ Object.values(ALCHEMY_YEAR_SETS).flat(),
13221322+);
13231323+13241324+/**
13251325+ * Check if a set code is an Alchemy set (Y-code or individual alchemy set)
13261326+ *
13271327+ * Used to detect alchemy decks for format suggestions.
13281328+ */
13291329+export function isAlchemySetCode(code: string): boolean {
13301330+ const lower = code.toLowerCase();
13311331+ // Check for Y-codes (y22, y23, etc.)
13321332+ if (ALCHEMY_YEAR_SETS[lower]) return true;
13331333+ // Check for individual alchemy sets (ymid, yneo, hbg, etc.)
13341334+ return ALL_ALCHEMY_SETS.has(lower);
13351335+}
13181336`;
1319133713201338 const tsPath = join(__dirname, "../src/lib/set-symbols.ts");