mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 07:48:37 +01:00
8 lines
195 B
TypeScript
8 lines
195 B
TypeScript
|
|
|
|
export function parseNumberInt(value: any, defaultValue: number) {
|
|
const int = parseInt(value);
|
|
if (!int) return defaultValue;
|
|
if (isNaN(int)) return defaultValue;
|
|
return int;
|
|
} |