mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 15:58:38 +01:00
new selfhosted version
This commit is contained in:
8
dashboard/utils/parseNumber.ts
Normal file
8
dashboard/utils/parseNumber.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
|
||||
export function parseNumberInt(value: any, defaultValue: number) {
|
||||
const int = parseInt(value);
|
||||
if (!int) return defaultValue;
|
||||
if (isNaN(int)) return defaultValue;
|
||||
return int;
|
||||
}
|
||||
Reference in New Issue
Block a user