1.0.38 • Published 5 years ago

hanson-js-utils v1.0.38

Weekly downloads
-
License
ISC
Repository
github
Last release
5 years ago

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

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.38

5 years ago

9.9.9

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

8.8.8

5 years ago

1.0.20

5 years ago

1.0.26

5 years ago

1.0.25

5 years ago

1.0.24

5 years ago

1.0.23

5 years ago

1.0.29

5 years ago

1.0.28

5 years ago

1.0.27

5 years ago

1.0.33

5 years ago

1.0.32

5 years ago

1.0.31

5 years ago

1.0.30

5 years ago

1.0.37

5 years ago

1.0.15

5 years ago

1.0.36

5 years ago

1.0.14

5 years ago

1.0.35

5 years ago

1.0.34

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago