An expression's `+` operands at depth 0, strings and brackets stepped over.
(text: string)
| 201 | |
| 202 | /** An expression's `+` operands at depth 0, strings and brackets stepped over. */ |
| 203 | function splitPlus(text: string): string[] { |
| 204 | const parts: string[] = []; |
| 205 | let start = 0; |
| 206 | for (let i = 0; i < text.length; i++) { |
| 207 | const ch = text[i]!; |
| 208 | if (ch === '"' || ch === "'" || ch === '`') { |
| 209 | const end = skipString(text, i); |
| 210 | if (end < 0) return [text]; |
| 211 | i = end; |
| 212 | } else if (ch === '(' || ch === '[' || ch === '{') { |
| 213 | const end = matchBracket(text, i); |
| 214 | if (end < 0) return [text]; |
| 215 | i = end; |
| 216 | } else if (ch === '+') { |
| 217 | parts.push(text.slice(start, i)); |
| 218 | start = i + 1; |
| 219 | } |
| 220 | } |
| 221 | parts.push(text.slice(start)); |
| 222 | return parts; |
| 223 | } |
| 224 | |
| 225 | /** The component a `component:` / `loadComponent:` value names. */ |
| 226 | function componentRef(field: 'component' | 'loadComponent', text: string): AngularComponentRef | null { |
no test coverage detected