This commit is contained in:
chashaobao
2025-12-07 21:28:15 +08:00
parent 587436058a
commit d4fb682852
5 changed files with 26 additions and 18 deletions

View File

@ -15,12 +15,10 @@ export const isDesktop = (() => {
return info.platform === 'windows' || info.platform === 'mac';
})();
export const logWithPrefix = isDev()
? (prefix: string) =>
(...args: BL.Anything[]) =>
console.log(`[${prefix}]`, ...args)
: (_prefix: string) =>
(..._args: BL.Anything[]) => {};
export const logWithPrefix =
(prefix: string) =>
(...args: BL.Anything[]) =>
console.log(`[${prefix}]`, ...args);
export const safeJsonParse = <T = BL.Anything>(str: string, defaultValue: BL.Anything = {}): T => {
try {