feat: migrate all

This commit is contained in:
TrèsAbhi committed 2025-10-02 10:15:38 -05:00
1 parent 5594c0ec3b
commit 320a764d45
38 files changed
+632 -600

No files matched your search

+12 -2
View File
@@ -1,9 +1,19 @@
import { assertSecret } from "@blitzkit/core";
const dev = assertSecret(import.meta.env.DEV);
export function literals(
string: string,
literals?: Record<string, string | number>
literals?: Record<string, string | number | undefined>
) {
for (const key in literals) {
string = string.replaceAll(`{${key}}`, `${literals[key]}`);
const mutated = string.replaceAll(`{${key}}`, `${literals[key]}`);
if (dev && mutated === string) {
console.warn(`Could not find literal {${key}} in string "${string}"`);
}
string = mutated;
}
return string;