0.1.22 • Published 1 year ago

@toolkit-fe/data v0.1.22

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

@tookit-fe/data

常用的数据处理函数集合。

API

joinStrings()

使用分隔符拼接字符串。

import { joinStrings } from '@toolkit-fe/data';

const result = joinStrings(['prefix', 'content', 'suffix'])
console.log(result)  // 'prefix-content-suffix'

const customDividerresult = joinStrings(['2023', '11', '27'], '/')
console.log(customDividerresult)  // '2023/11/27'

doSthWithListWhenNotEmpty

在数据非空时执行逻辑。

import { doSthWithListWhenNotEmpty } from '@toolkit-fe/data';

const list = []
const list1 = ['item']
doSthWithListWhenNotEmpty(list, ()=>{
	list.push('item')
})
doSthWithListWhenNotEmpty(list1, ()=>{
	list1.push('item')
})
console.log(list) // []
console.log(list1) // ['item', 'item']
0.1.21

1 year ago

0.1.22

1 year ago

0.1.8

2 years ago

0.1.3

2 years ago

0.1.0

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago