MCPcopy Index your code
hub / github.com/nodejs/node / parseCommaParts

Function parseCommaParts

deps/minimatch/index.js:102–122  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

100 return str.replace(escSlashPattern, "\\").replace(escOpenPattern, "{").replace(escClosePattern, "}").replace(escCommaPattern, ",").replace(escPeriodPattern, ".");
101 }
102 function parseCommaParts(str) {
103 if (!str) {
104 return [""];
105 }
106 const parts = [];
107 const m = (0, balanced_match_1.balanced)("{", "}", str);
108 if (!m) {
109 return str.split(",");
110 }
111 const { pre, body, post } = m;
112 const p = pre.split(",");
113 p[p.length - 1] += "{" + body + "}";
114 const postParts = parseCommaParts(post);
115 if (post.length) {
116 ;
117 p[p.length - 1] += postParts.shift();
118 p.push.apply(p, postParts);
119 }
120 parts.push.apply(parts, p);
121 return parts;
122 }
123 function expand(str, options = {}) {
124 if (!str) {
125 return [];

Callers 1

expand_Function · 0.85

Calls 3

splitMethod · 0.45
shiftMethod · 0.45
applyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…