1.3.0 • Published 6 years ago
sd-browser-common v1.3.0
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参数转对象 |