mirror of
https://github.com/toss/es-toolkit.git
synced 2024-11-28 03:34:26 +03:00
fix(isLength): modernize checking type of a safe integer (#322)
This commit is contained in:
parent
831501ad92
commit
5c1251c5a5
@ -1,3 +1,3 @@
|
||||
export function isLength(value: unknown): value is number {
|
||||
return typeof value === 'number' && value > -1 && value % 1 === 0 && value <= Number.MAX_SAFE_INTEGER;
|
||||
return Number.isSafeInteger(value) && (value as number) >= 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user