1.3.0 • Published 5 years ago
xp-utils v1.3.0
xp-utils
A JavaScript utility library
Installation
npm i xp-utils --save
Usage
- Fully use
import _ from 'xp-utils'
const obj1 = { a: 1, b: { c: 2 } }
const obj2 = _.deepClone(obj1) // const obj2 = clone.deepClone(obj1)
obj2.a = 3
console.log(obj1) // { a: 1, b: { c: 2 } }
console.log(obj2) // { a: 3, b: { c: 2 } }
- On demand
import { deepClone } from 'xp-utils'
const obj1 = { a: 1, b: { c: 2 } }
const obj2 = deepClone(obj1)
obj2.a = 3
console.log(obj1) // { a: 1, b: { c: 2 } }
console.log(obj2) // { a: 3, b: { c: 2 } }
Methods
clone.js
- deepClone
array.js
- swap
- unique
- newArray
throtte.js
- throtte
- debounce
date.js
- formatDate
- duration
- ago
url.js
- qs
- qsStringify
string.js
- len
- subStr
- padStart
- padEnd
ua.js
- isIOS
- isAndroid
- isMobile
body-scroll.js
- lockScroll
security.js
- decode
- encode
- escapeHtml
- escapeJs
1.3.0
5 years ago
1.2.0
6 years ago
1.1.9
6 years ago
1.1.8
6 years ago
1.1.7
6 years ago
1.1.6
6 years ago
1.1.5
6 years ago
1.1.4
6 years ago
1.1.3
6 years ago
1.1.2
6 years ago
1.1.1
6 years ago
1.1.0
7 years ago
1.0.9
7 years ago
1.0.8
7 years ago
1.0.7
7 years ago
1.0.6
7 years ago
1.0.5
7 years ago
1.0.4
7 years ago
1.0.3
7 years ago
1.0.2
7 years ago
1.0.1
7 years ago
1.0.0
7 years ago