Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix NaN validation
  • Loading branch information
SkyaTura authored Jan 13, 2025
commit 1bc47bbf8789cc2b7cbda6b9cd40e2d751fc320d
6 changes: 4 additions & 2 deletions src/utils/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ export const getType = (val: any) => {
if (val === null) return 'null';
if (val === undefined) return 'undefined';
if (typeof val === 'string') return 'string';
if (isNaN(val)) return 'NaN';
if (typeof val === 'number') return 'number';
if (typeof val === 'number') {
if (Number.isNaN(val)) return 'NaN';
return 'number';
}
if (typeof val === 'boolean') return 'boolean';
if (typeof val === 'symbol') return 'symbol';
if (typeof val === 'bigint') return 'bigint';
Expand Down