Skip to content

Fov6363/parseNumber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#normal Util

#demo

parseIntDefault(1,0) => 1
parseIntDefault('1',0) => 1
parseIntDefault('abc',0) => 0
parseIntDefault([],0) => 0
parseIntForce(1) ==> 1
parseIntForce('1') ==> 1
parseIntForce('abc') ==> throw new Error(`parseIntForce num fail,num = ${num}`)
parseIntForce('abc','param error') ===> throw new Error('param error');
isJson({"a":1}) ==> true
isJson("{'aa':112}") ==> true
isJson(11) ==> false
isJson([]) ==> false
isJson("12") ==> false
isNumber("12") ==> true
isNumber(11) ==> true
isNumber("abc") ==> false
isNumber([]) ==> false
isNumber("") ==> false

About

Node parse Number

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published