MCPcopy Create free account
hub / github.com/Effect-TS/effect / isTemplateLiteralPart

Function isTemplateLiteralPart

packages/effect/src/SchemaAST.ts:1106–1120  ·  view source on GitHub ↗
(ast: AST)

Source from the content-addressed store, hash-verified

1104 | Union<TemplateLiteralPart>
1105
1106function isTemplateLiteralPart(ast: AST): ast is TemplateLiteralPart {
1107 switch (ast._tag) {
1108 case "String":
1109 case "Number":
1110 case "BigInt":
1111 return true
1112 case "Literal":
1113 case "TemplateLiteral":
1114 return !ast.checks
1115 case "Union":
1116 return !ast.checks && ast.types.every(isTemplateLiteralPart)
1117 default:
1118 return false
1119 }
1120}
1121
1122/**
1123 * AST node representing a TypeScript template literal type

Callers 1

constructorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected