add some base utilities
This commit is contained in:
@@ -0,0 +1,10 @@
|
|||||||
|
export function trim (str) {
|
||||||
|
if (!str) return str
|
||||||
|
return str.replace(/^\s+|\s+$/g, '')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function toCommaList (arr, key = 'name') {
|
||||||
|
if (!arr) return
|
||||||
|
return arr.map(item => item[key]).join(', ')
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user