MCPcopy Create free account
hub / github.com/arktypeio/arktype / maybeParseTupleExpression

Function maybeParseTupleExpression

ark/type/parser/tupleExpressions.ts:69–75  ·  view source on GitHub ↗
(
	def: array,
	ctx: BaseParseContext
)

Source from the content-addressed store, hash-verified

67import type { BaseCompletions } from "./string.ts"
68
69export const maybeParseTupleExpression = (
70 def: array,
71 ctx: BaseParseContext
72): BaseRoot | null =>
73 isIndexZeroExpression(def) ? indexZeroParsers[def[0]](def as never, ctx)
74 : isIndexOneExpression(def) ? indexOneParsers[def[1]](def as never, ctx)
75 : null
76
77export type maybeValidateTupleExpression<def extends array, $, args> =
78 def extends IndexZeroExpression ? validatePrefixExpression<def, $, args>

Callers 1

parseTupleFunction · 0.90

Calls 2

isIndexZeroExpressionFunction · 0.85
isIndexOneExpressionFunction · 0.85

Tested by

no test coverage detected