@fastweb/utils

2.0.0 • Public • Published

常用utils Build Status npm


常用utils方法:isEmpty,getCookie,setCookie,getQuery,parseQuery,parseDate,dbclick

方法

isEmpty(obj)

判断空对象 obj=null|undefined|{} 返回true

getCookie(key)

获取cookie

setCookie(key, value, expires, path, domain)

设置cookie key [key] value [value] expires [保留多少个小时] path [路径] domain [域]

getQuery(key)

获取url参数

parseQuery(url)

讲url上的参数转为json url默认为location.href

parseDate(date, fmt)

格式化时间 fmt默认为"YYYY-MM-DD hh:mm:ss" Y年M月D天H24制小时h12制小时m分s秒S毫秒

dbclick

取消双击(触发ios浏览器双击窗口偏移bug时使用)

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.0
    1
  • 1.0.2
    0
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i @fastweb/utils

Weekly Downloads

1

Version

2.0.0

License

ISC

Last publish

Collaborators

  • yuer
  • tellmepz
  • lkfu
  • hughgr
  • yuhonyon
  • deandai