Skip to content

Commit dc761d4

Browse files
committed
better isNumeric
1 parent 6380abd commit dc761d4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

OpenFlowNodeRED/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ process.on('unhandledRejection', up => {
3535
// function isNumeric(n) {
3636
// return !isNaN(parseFloat(n)) && isFinite(n);
3737
// }
38-
function isNumeric(val) {
39-
return Number(parseFloat(val)) === val;
38+
function isNumeric(num) {
39+
return !isNaN(num)
4040
}
4141
(async function (): Promise<void> {
4242
try {

0 commit comments

Comments
 (0)