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

Function operatorOf

ark/aot/scope.ts:841–850  ·  view source on GitHub ↗
(
	node: Node
)

Source from the content-addressed store, hash-verified

839
840// e.g. `T!` and `T!.and` for `T`
841export const operatorOf = (
842 node: Node
843): [operand: Node, operator: Node | undefined] => {
844 while (
845 node.parent &&
846 (isTransparent(node.parent) || node.parent.type === "ChainExpression")
847 )
848 node = node.parent
849 return [node, node.parent ?? undefined]
850}
851
852// e.g. `o.a` in `o.a = 1`, `delete o.a` or `({ x: o.a } = p)`
853export const isWriteTarget = (node: Node): boolean => {

Callers 15

genericDefinitionOfFunction · 0.90
innermostSnippetOfFunction · 0.90
isReadThroughMethod · 0.90
isRunAtLoadByFunction · 0.90
isUsedAtLoadFunction · 0.90
throwsUnsetFunction · 0.90
bakeAtFunction · 0.90
readAtMethod · 0.90
memberMethod · 0.90
callsOfMethod · 0.90
callsOfBindingMethod · 0.90
readBindingMethod · 0.90

Calls 1

isTransparentFunction · 0.90

Tested by

no test coverage detected