(str?: string, sep?: string)
| 15 | * @param {String} [sep] default is ',' |
| 16 | */ |
| 17 | export function split(str?: string, sep?: string) { |
| 18 | str = str || ''; |
| 19 | sep = sep || ','; |
| 20 | const needs: string[] = []; |
| 21 | for (const item of str.split(sep)) { |
| 22 | const s = item.trim(); |
| 23 | if (s.length > 0) { |
| 24 | needs.push(s); |
| 25 | } |
| 26 | } |
| 27 | return needs; |
| 28 | } |
| 29 | // keep compatibility |
| 30 | export const splitAlwaysOptimized = split; |
| 31 |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…