fix: instance type format in list

This commit is contained in:
jialin
2026-05-31 22:23:32 +08:00
committed by jialin
parent 55028cf3a3
commit d95fd8dc90
4 changed files with 81 additions and 18 deletions
+8
View File
@@ -106,3 +106,11 @@ export const ceilMilliToCore = (
num: parsed.base / outFactor
};
};
export const parseJsonSafe = <T>(value: string, fallback: T): T => {
try {
return JSON.parse(value) as T;
} catch {
return fallback;
}
};