sd-browser-common

水滴前端公共工具库

Usage no npm install needed!

<script type="module">
  import sdBrowserCommon from 'https://cdn.skypack.dev/sd-browser-common';
</script>

README

common

公共方法库

Usage

const Common = require('sd-browser-common');

// 获取对象值
const obj = {
    'a': [{
      'b': {
        'c': 3
      }
    }]
  }
Common.get(obj, 'a[0].b.c') // 3
Common.get(obj, ['a', '0', 'b', 'c']) // 3
Common.get(obj, 'a.b.c', 'default') // 'default'
Common.get(obj, 'a.c') // undefined

支持的API

|名称|描述| |--|--| |get|获取对象值| |cloneDeep|深拷贝| |throttle|节流| |debounce|防抖| |parseQueryString|url参数转对象|