mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-26 03:59:53 +01:00
Update literals.ts
This commit is contained in:
1 parent
0552ac790e
commit
1d319551e7
1 file changed
+1
-3
@@ -1,7 +1,5 @@
|
|||||||
import { assertSecret } from "@blitzkit/core";
|
import { assertSecret } from "@blitzkit/core";
|
||||||
|
|
||||||
const dev = assertSecret(import.meta.env.DEV);
|
|
||||||
|
|
||||||
export function literals(
|
export function literals(
|
||||||
string: string,
|
string: string,
|
||||||
literals?: Record<string, string | number | undefined>
|
literals?: Record<string, string | number | undefined>
|
||||||
@@ -9,7 +7,7 @@ export function literals(
|
|||||||
for (const key in literals) {
|
for (const key in literals) {
|
||||||
const mutated = string.replaceAll(`{${key}}`, `${literals[key]}`);
|
const mutated = string.replaceAll(`{${key}}`, `${literals[key]}`);
|
||||||
|
|
||||||
if (dev && mutated === string) {
|
if (import.meta.env.DEV && mutated === string) {
|
||||||
console.warn(`Could not find literal {${key}} in string "${string}"`);
|
console.warn(`Could not find literal {${key}} in string "${string}"`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user