MCPcopy Index your code
hub / github.com/node-modules/utility / split

Function split

src/string.ts:17–28  ·  view source on GitHub ↗
(str?: string, sep?: string)

Source from the content-addressed store, hash-verified

15 * @param {String} [sep] default is ','
16 */
17export 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
30export const splitAlwaysOptimized = split;
31

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…