@warmthsea/utils
v0.1.3
Published
[![NPM version](https://img.shields.io/npm/v/@warmthsea/utils?color=a1b858&label=)](https://www.npmjs.com/package/@warmthsea/utils) [![NPM download](https://img.shields.io/npm/dm/@warmthsea/utils?color=50a36f&label=)](https://www.npmjs.com/package/@warmt
Downloads
10
Readme
@warmthsea/utils
📦 Install
pnpm i @warmthsea/utils
🦄 Usage
utilAwaitTime
async function testFun () {
await utilAwaitTime(300) // => setTimeout(() => { ... }, 300)
console.log('load')
}
utilDelay
let num = 1
function continuousClickFun (){
utilDelay(() => {
num ++
console.log(num)
}, 300)
}
utilGetSuffix
console.log(utilGetSuffix('test.pdf')) // => pdf
utilFormData
const testObject = {
a: 1,
b: 'test'
c: undefined
}
console.log(utilFormData(testObject)) // => { a: 1, b: 'test' }
utilObjectFilter
const testObject = {
a: 0,
b: false
c: undefined
}
console.log(utilObjectFilter(testObject)) // => { a: 0, b: false }
utilDownBlobFile
// request responseType is 'blob'
utilDownBlobFile(fileBlob,'text.xlsx')
utilObjectArrayIncludes
const list = [{
num: 1
},{
num: 2
}]
const item = {
num: 1
}
utilObjectArrayIncludes(list, item) // => true