说明(持续更新中...)
JS方法包
- 安装
npm install lints-pack or yarn add lints-pack
- ES6 引入使用
import LINTS from 'lints-pack';
使用实例
T
时间复杂度测试
LINTS.T(foo())
// func eval可执行的js字符串或方法
// 控制台输出foo()方法运行花费时间
// output: time: 0.181884765625ms
addZero
数字不满10前面加0
LINTS.addZero(8)
// num string or number
// output: 08
deepCopy
对象深度拷贝
LINTS.deepCopy(source);
// return object
judgeDevice
设备判断
LINTS.judgeDevice();
// return android or ios or pc
judgeDataType
数据类型判断
LINTS.judgeDataType(foo);
// return null、array、object、number、string、boolean、undefined、other_type //未知类型