Skip to content

Commit

Permalink
chore(refactor): use Number.isInteger in isIntString
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Jun 24, 2024
1 parent 5114eb2 commit 0e3a83a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/typed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const isInt = (value: any): value is number => {
export const isIntString = (value: any): value is string => {
if (!isString(value)) return false
const num = +value
return num === Math.floor(num) && `${num}` === value
return Number.isInteger(num) && `${num}` === value
}

export const isFloat = (value: any): value is number => {
Expand Down

0 comments on commit 0e3a83a

Please sign in to comment.