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

Function throwsUnset

ark/aot/interpreter.ts:3508–3518  ·  view source on GitHub ↗
(node: Node)

Source from the content-addressed store, hash-verified

3506
3507// e.g. `V.and()` or `V()`, but not `V ?? x` or `V?.and()`
3508const throwsUnset = (node: Node): boolean => {
3509 const [operand, parent] = operatorOf(node)
3510 return (
3511 (parent?.type === "MemberExpression" &&
3512 parent.object === operand &&
3513 !parent.optional) ||
3514 (parent?.type === "CallExpression" &&
3515 parent.callee === operand &&
3516 !parent.optional)
3517 )
3518}
3519
3520// the expression a variable is only ever set to
3521export const initOf = (binding: Binding): Node | undefined => {

Callers 1

unreadableBindingOfMethod · 0.85

Calls 1

operatorOfFunction · 0.90

Tested by

no test coverage detected