Skip to content

Commit

Permalink
fix(core): use Number.isFinite() to verify input, fix #302
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Jul 17, 2021
1 parent 20e6522 commit e625328
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/koishi-core/src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export namespace Argv {

createDomain('number', (source) => {
const value = +source
if (value * 0 === 0) return value
if (Number.isFinite(value)) return value
throw new Error(template('internal.invalid-number'))
})

Expand Down

0 comments on commit e625328

Please sign in to comment.