这是一个工具库
如果有用户使用, 请用户自行检验
git 地址 https://gitee.com/hanhanker/hantools.git
- npm i hantools --save
具体的方法请进入 src 文件内查看
- arrFun 数组处理
- dateFun 日期处理
- encryptFun 数据脱敏
- infoFun 作者信息
- mathFun 数字处理、加减乘除精度处理
- objFun 对象深、浅拷贝
- storeFun 本地存储
- stringFun 字符串处理
isArray
arrChunk
arrCompact
arrUnique
arrSort
arrObjSort
convertToTree
convertToFlat
orgDate
getTimestamp
compareDate
getDateDiffDay
getNextDate
getNextMonthDate
getBetweenDate
getDateTime
getDate
getMaxDate
isLeapYear
getMonthDays
numberFormat
decimalsFormat
twoDecimalNumberFormat
floatToPercent
percentToFloat
removeDecimalZero
floatAdd
floatSub
floatMul
floatDiv
convertCurrency
is0
isEmptyNot0
toWan
toThousand
deepClone
clone
validObj
isObject
isEmptyObj
mergeObj
delNullAttr
debounceFun
throttleFun
setStore
getStore
removeStore
clearStore
setStoreSession
getStoreSession
removeStoreSession
clearStoreSession
strReverse
strLtrim
strRtrim
strTrim
randomString
getURLParams
getObjUrl
testIdCard
acctNoFormat
countStrToBit
本项目基于 git 项目二次开发 https://github.com/xiaomingplus/npm-typescript-boilerplate 感谢大佬 xiaomingplus
集合了下面几个工具库中最常用的函数 npm install dayjs npm install lodash npm install qs npm i merge
- Fork 本仓库
- 新建 Feat_xxx 分支
- 提交代码
- 新建 Pull Request
- 先去 npm 官网注册账号:https://www.npmjs.com/,或者通过终端命令注册:npm adduser
- 终端命令,登录 npm 账号:npm login
0.需要到 package.json 里面修改版本
1.切到 npm 源 npm config set registry https://registry.npmjs.org/
2.直接部署 npm publish
开发测试 npm run test 修改__tests__里的测试函数
最后需要设置回国内镜像 npm config set registry https://registry.npmmirror.com
查看 npm get registry
hanker hancuiyang@163.com