(value: PossibleCodeScope)
| 37 | } |
| 38 | |
| 39 | export function parseCodeScope(value: PossibleCodeScope): CodeScope { |
| 40 | if (typeof value === 'string') { |
| 41 | return { |
| 42 | progress: 0, |
| 43 | fragments: [value], |
| 44 | }; |
| 45 | } |
| 46 | |
| 47 | if (Array.isArray(value)) { |
| 48 | return { |
| 49 | progress: 0, |
| 50 | fragments: value, |
| 51 | }; |
| 52 | } |
| 53 | |
| 54 | return value; |
| 55 | } |
| 56 | |
| 57 | type IsAfterPredicate = ((scope: CodeScope) => boolean) | boolean; |
| 58 |