mirror of
https://github.com/lifegpc/eh-downloader.git
synced 2026-07-08 01:31:00 +08:00
Add Auto Dark Mode support
This commit is contained in:
@@ -11,3 +11,13 @@ export function parse_bool<T extends boolean | null>(
|
||||
return n !== 0;
|
||||
}
|
||||
}
|
||||
|
||||
export function parse_int<T extends number | null>(
|
||||
value: string | null,
|
||||
def: T,
|
||||
): number | T {
|
||||
if (value === null) return def;
|
||||
const n = parseInt(value);
|
||||
if (isNaN(n)) return def;
|
||||
return n;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user