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

Function deferUnits

ark/type/deferred.ts:1472–1480  ·  view source on GitHub ↗
(
	values: unknown[],
	$: InternalScope
)

Source from the content-addressed store, hash-verified

1470
1471/** `type.unit` and `type.enumerated`, as the literals that are the same Type */
1472export const deferUnits = (
1473 values: unknown[],
1474 $: InternalScope
1475): BaseRoot | undefined => {
1476 const literals = values.map(literalOf)
1477 return literals.length === 1 ?
1478 deferDefinition(literals[0], $)
1479 : deferUnion(literals, $)
1480}
1481
1482/** `type.Record`, which is its generic once it's anything but called on what can defer */
1483export const deferredRecord = (

Callers 1

constructorMethod · 0.90

Calls 3

deferDefinitionFunction · 0.85
deferUnionFunction · 0.85
mapMethod · 0.65

Tested by

no test coverage detected