| 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 []; |