npm.io
1.0.6 • Published 6 years ago

jm-utils

Licence
MIT
Version
1.0.6
Deps
0
Size
42 kB
Vulns
0
Weekly
0

jm-utils

utils

参数转换

undefined 值不转换,直接返回undefined

  • arg2bool

参数值转换为布尔值

'true', true, >0的数字和数字串 转为 true

其他转为false

  • arg2number

参数值转换为数字值

'true', true 转为 1

数字串直接转数字

其他都转为0

Keywords