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

Function isDiscardedAssignment

ark/aot/usage.ts:1428–1439  ·  view source on GitHub ↗
(node: Node)

Source from the content-addressed store, hash-verified

1426}
1427
1428const isDiscardedAssignment = (node: Node): boolean => {
1429 const [operand, parent] = operatorOf(node)
1430 if (!parent) return false
1431 if (parent.type === "ExpressionStatement") return true
1432 if (parent.type === "SequenceExpression") {
1433 return (
1434 parent.expressions[parent.expressions.length - 1] !== operand ||
1435 isDiscardedAssignment(parent)
1436 )
1437 }
1438 return false
1439}
1440
1441const isDiscardedProtoMethodWrite = (
1442 member: Extract<Node, { type: "MemberExpression" }>

Callers 3

isSubProtoCreateFunction · 0.85
es5ProtoMethodOfFunction · 0.85

Calls 1

operatorOfFunction · 0.90

Tested by

no test coverage detected