1.0.38 • Published 4 years ago
hanson-js-utils v1.0.38
hanson-js-utils
前端工具库
API
Object类
- isObject 判断是否为对象
- isEmpty 判断是否为空
- deepClone 深拷贝
- deepDeleteEmptyValue 过滤对象空值
Date类
- formatTime 格式化时间戳
打包
npm run build
单元测试
npm run test
打包并自动发布到npm
npm run buildAndPublish
安装
npm i hanson-js-utils
使用(全局/按需引入)
import hansonJsUtils, { deepDeleteEmptyValue, isEmpty, deepClone, isObject, formatTime } from 'hanson-js-utils'
console.log(hansonJsUtils.deepDeleteEmptyValue({a: 1, b: '', c: null, d: false})) // {a: 1, d: false}
console.log(deepDeleteEmptyValue({a: 1, b: '', c: null, d: false})) // {a: 1, d: false}
console.log(isEmpty('')) // true
console.log(deepClone({a: 1})) // {a: 1}
console.log(isObject(123)) // false
console.log(isObject({})) // true
console.log(formatTime(new Date())); // 2021-03-30 18:00:00
console.log(formatTime(new Date(), 'yyyy-MM-dd')); // 2021-03-30
1.0.19
4 years ago
1.0.18
4 years ago
1.0.17
4 years ago
1.0.38
4 years ago
9.9.9
4 years ago
1.0.22
4 years ago
1.0.21
4 years ago
8.8.8
4 years ago
1.0.20
4 years ago
1.0.26
4 years ago
1.0.25
4 years ago
1.0.24
4 years ago
1.0.23
4 years ago
1.0.29
4 years ago
1.0.28
4 years ago
1.0.27
4 years ago
1.0.33
4 years ago
1.0.32
4 years ago
1.0.31
4 years ago
1.0.30
4 years ago
1.0.37
4 years ago
1.0.15
4 years ago
1.0.36
4 years ago
1.0.14
4 years ago
1.0.35
4 years ago
1.0.34
4 years ago
1.0.11
4 years ago
1.0.10
4 years ago
1.0.13
4 years ago
1.0.12
4 years ago
1.0.8
4 years ago
1.0.7
4 years ago
1.0.6
4 years ago
1.0.5
4 years ago
1.0.4
4 years ago
1.0.2
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago