groupBranchesByTypeof()
groupBranchesByTypeof(
branches):Map<string,number[]>
Experimental
Groups union branches by their typeof check for optimization.
Primitive unions like string | number can use a single typeof check.
Parametersโ
branches: UnionBranchMeta[]โ
Union branches to analyze
Returns: Map<string, number[]>โ
Map of typeof values to branch indices
Sinceโ
2.0.0