* The loader of a conditional's one branch that has one: SigNoz's `IS_DEV ? * React.lazy(() => import(…)) : null`. Null when neither branch loads, or both * do — the value is then one or the other.
(text: string)
| 791 | * do — the value is then one or the other. |
| 792 | */ |
| 793 | function conditionalLoader(text: string): string | null { |
| 794 | const branches = conditionalBranches(text); |
| 795 | const loaders = branches ? branches.map(loaderOf).filter((l): l is string => l !== null) : []; |
| 796 | return loaders.length === 1 ? loaders[0]! : null; |
| 797 | } |
| 798 | |
| 799 | /** The two branches of a conditional expression, `test ? yes : no`; null for any other expression. */ |
| 800 | function conditionalBranches(text: string): [string, string] | null { |
no test coverage detected