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(', ') }