MCPcopy Create free account
hub / github.com/microsoft/typescript-go / createUnionOrIntersectionTypeNode

Method createUnionOrIntersectionTypeNode

internal/parser/parser.go:2666–2675  ·  view source on GitHub ↗
(operator ast.Kind, types *ast.NodeList)

Source from the content-addressed store, hash-verified

2664}
2665
2666func (p *Parser) createUnionOrIntersectionTypeNode(operator ast.Kind, types *ast.NodeList) *ast.Node {
2667 switch operator {
2668 case ast.KindBarToken:
2669 return p.factory.NewUnionTypeNode(types)
2670 case ast.KindAmpersandToken:
2671 return p.factory.NewIntersectionTypeNode(types)
2672 default:
2673 panic("Unhandled case in createUnionOrIntersectionType")
2674 }
2675}
2676
2677func (p *Parser) parseTypeOperatorOrHigher() *ast.TypeNode {
2678 operator := p.token

Callers 1

Calls 3

panicFunction · 0.85
NewUnionTypeNodeMethod · 0.80

Tested by

no test coverage detected