https://github.com/suyanhanx/hanutil
A repository of JavaScript common utils
https://github.com/suyanhanx/hanutil
javascript javascript-library util utils
Last synced: about 1 year ago
JSON representation
A repository of JavaScript common utils
- Host: GitHub
- URL: https://github.com/suyanhanx/hanutil
- Owner: suyanhanx
- License: mit
- Created: 2018-09-24T13:20:57.000Z (over 7 years ago)
- Default Branch: develop
- Last Pushed: 2023-07-11T20:55:02.000Z (almost 3 years ago)
- Last Synced: 2025-04-06T05:39:19.174Z (about 1 year ago)
- Topics: javascript, javascript-library, util, utils
- Language: JavaScript
- Homepage: https://suyan.moe/hanutil
- Size: 336 KB
- Stars: 5
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hanutil
[](https://www.npmjs.com/package/hanutil)

[](https://coveralls.io/github/suyanhanx/hanutil?branch=develop)


## 前端公共方法库
为了节约花在项目编写时寻找常用方法的时间,开设此库,方便使用。
## 引入方式
可以完整引入整个包方便取用,也可以单独引入一个方法
``` javascript
// 只引入部分方法('hanutil/<方法名>')
const isArray = require('hanutil/isArray')
```
## APIs
具体函数签名可以参考[index.d.ts][index]
### Array
#### [arrayEqual: 判断两个数组是否相同][arrayEqual]
#### [convertClass: 将 String, Object, Array 转成 Array][convertClass]
#### [isArray: 判断是否是一个数组][isArray]
### Cookie
#### [getCookie: 获取cookie][getCookie]
#### [removeCookie: 移除cookie][removeCookie]
#### [setCookie: 设置cookie][setCookie]
### Function
#### [debounce: 函数防抖][debounce]
#### [throttle: 函数节流][throttle]
### Object
#### [deepAssign: 深度合并][deepAssign]
#### [deepClone: 深克隆][deepClone]
#### [getProperty: 由路径获取属性值][getProperty]
#### [isDef: 判断是否已定义][isDef]
#### [isEmptyObject: 判断是否是空对象][isEmptyObject]
### Validate
#### [isCarNumber: 车牌号验证][isCarNumber]
#### [isEmail: 电子邮箱email验证][isEmail]
#### [isIdCard: 身份证号码验证][isIdCard]
#### [isPhoneNum: 手机号验证][isPhoneNum]
#### [isTaxNumber: 税号验证][isTaxNumber]
[index]:https://github.com/suyanhanx/hanutil/blob/master/index.d.ts
[arrayEqual]:https://github.com/suyanhanx/hanutil/blob/master/src/array/arrayEqual.js
[convertClass]:https://github.com/suyanhanx/hanutil/blob/master/src/array/convertClass.js
[isArray]:https://github.com/suyanhanx/hanutil/blob/master/src/array/isArray.js
[getCookie]:https://github.com/suyanhanx/hanutil/blob/master/src/cookie/getCookie.js
[removeCookie]:https://github.com/suyanhanx/hanutil/blob/master/src/cookie/removeCookie.js
[setCookie]:https://github.com/suyanhanx/hanutil/blob/master/src/cookie/setCookie.js
[debounce]:https://github.com/suyanhanx/hanutil/blob/master/src/function/debounce.js
[throttle]:https://github.com/suyanhanx/hanutil/blob/master/src/function/throttle.js
[deepAssign]:https://github.com/suyanhanx/hanutil/blob/master/src/object/deepAssign.js
[deepClone]:https://github.com/suyanhanx/hanutil/blob/master/src/object/deepClone.js
[getProperty]:https://github.com/suyanhanx/hanutil/blob/master/src/object/getProperty.js
[isDef]:https://github.com/suyanhanx/hanutil/blob/master/src/object/isDef.js
[isEmptyObject]:https://github.com/suyanhanx/hanutil/blob/master/src/object/isEmptyObject.js
[isCarNumber]:https://github.com/suyanhanx/hanutil/blob/master/src/validate/isCarNumber.js
[isEmail]:https://github.com/suyanhanx/hanutil/blob/master/src/validate/isEmail.js
[isIdCard]:https://github.com/suyanhanx/hanutil/blob/master/src/validate/isIdCard.js
[isPhoneNum]:https://github.com/suyanhanx/hanutil/blob/master/src/validate/isPhoneNum.js
[isTaxNumber]:https://github.com/suyanhanx/hanutil/blob/master/src/validate/isTaxNumber.js