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

Function canDefer

ark/type/deferred.ts:1442–1459  ·  view source on GitHub ↗
($: InternalScope)

Source from the content-addressed store, hash-verified

1440
1441// no scope but ark says what the scanned keywords are
1442const canDefer = ($: InternalScope) => {
1443 if (
1444 !$.isBuiltin ||
1445 $.name !== "ark" ||
1446 $ark.reached ||
1447 $ark.eagerTypes ||
1448 settling ||
1449 bindPrecompiledUnits ||
1450 inProgress.definitions ||
1451 inProgress.resolutions
1452 )
1453 return false
1454 // what else config changes could be what a definition parses to, where
1455 // jitless changes only whether it compiles
1456 for (const k in $ark.config)
1457 if (k !== "exactOptionalPropertyTypes" && k !== "jitless") return false
1458 return true
1459}
1460
1461const literalOf = (value: unknown) =>
1462 typeof value === "string" ?

Callers 4

deferUnionFunction · 0.85
deferred.tsFile · 0.85
instantiateFunction · 0.85
deferDefinitionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected