Options
All
  • Public
  • Public/Protected
  • All
Menu

zmethods

zmethods

some methods that we always use

NPM version npm codecov

Install

$ npm install zmethods --save

Build

$ npm run build

Test

$ npm run test

Deploy Docs

$ npm run deploy-docs

Methods

  • debounce 防抖
  • throttle 节流
  • sleep 睡眠
  • arrUnique 数组去重
  • toIndexOf 判断是否在数组中
  • byteFormat byte换算
  • thousandsDot 数组每三位逗号分隔
  • deepCopy 对象/数组深拷贝
  • guid 生成guid
  • numPadding 数字补零
  • findLackNum 查找顺序数字中缺失的数字
  • arrChunk 数组按指定大小分割
  • isJSON 判断是否是JSON
  • arrShuffle 打乱数组
  • queryFormate Object => URL查询参数格式化
  • arrEqual 两数组相等, 参数相同, 个数相同, 位置不一定相同
  • arrRandom 随机从数组中抽取指定数量的不重复项
  • strSecret 字符串局部加密打星号
  • numChineseCapital 将数字转为中文大写

Generated using TypeDoc