We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7270e85 commit 8bafb89Copy full SHA for 8bafb89
1 file changed
src/lib/helpers/prefs.ts
@@ -55,6 +55,17 @@ export function sanitizePrefs(prefs: PrefRow[]) {
55
export function parsePrefValue(value: string, original: unknown): unknown {
56
const trimmed = value.trim();
57
58
+ if (typeof original === 'number') {
59
+ const parsed = Number(trimmed);
60
+ return Number.isNaN(parsed) ? value : parsed;
61
+ }
62
+
63
+ if (typeof original === 'boolean') {
64
+ if (trimmed === 'true') return true;
65
+ if (trimmed === 'false') return false;
66
+ return value;
67
68
69
if (!trimmed.startsWith('{') && !trimmed.startsWith('[')) return value;
70
71
try {
0 commit comments