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

Function keyIn

ark/aot/graph.ts:6282–6285  ·  view source on GitHub ↗
(owner: Node, node: Node)

Source from the content-addressed store, hash-verified

6280 : property.key.name
6281
6282const keyIn = (owner: Node, node: Node): unknown =>
6283 owner.type === "Property" ? keyNameOf(owner)
6284 : owner.type === "ArrayPattern" ? owner.elements.indexOf(node as never)
6285 : undefined
6286
6287// e.g. `type(A, "|", B)`, as only `type("<t>", def)` makes a Generic
6288// e.g. `type({ a: "string" })` or `type(User, "[]")`, but not `type("<t>", def)`

Callers 2

patternKindOfMethod · 0.85
destructuredValueOfMethod · 0.85

Calls 1

keyNameOfFunction · 0.70

Tested by

no test coverage detected