dr_util

1.0.2 • Public • Published

常用函数封装


包括我们平时用到的基本函数及判断

  • ObjToUrl                对象URL拼接
  • ObjToArrry             对象转数组
  • n_ajax                     原生ajax封装
  • p_ajax                     pormise ajax封装
  • debounce                函数防抖
  • throttle                    函数节流
  • copy                        深浅拷贝
  • extend                    方法继承
  • c_factorial               普通递归阶乘
  • t_factorial               尾递归阶乘
  • quickSort               快速排序
  • bubbleSort             冒泡排序
  • selectionSort             选择排序
  • binaryInsertionSort             插入排序
  • shellSort                    希尔排序
  • mergeSort                 归并排序
  • heapSort                   堆排序
  • countingSort             计数排序
  • deviceType               判断设备来源
  • isWeixin                   判断是否在微信端
  • GetRequest             截取URL参数保存至对象
  • jsonp                       jsonp 跨域封装
  • getUrlParam            获取url中指定参数的值

安装使用

  • npm install dr_util --save      (或者使用cnpm)
  • const dr = require('./dr_util') 或者 import dr from 'dr_util'
  • 例如判断当前浏览器环境是否是微信端
  • dr.isWeiXin()      // flase 不是微信端

Readme

Keywords

Package Sidebar

Install

npm i dr_util

Weekly Downloads

1

Version

1.0.2

License

ISC

Unpacked Size

19.4 kB

Total Files

4

Last publish

Collaborators

  • wginit