MCPcopy Create free account
hub / github.com/thetarnav/solid-devtools / equal

Function equal

packages/main/src/babel/babel.ts:12–27  ·  view source on GitHub ↗
(a: Comparable, b: Comparable)

Source from the content-addressed store, hash-verified

10
11type Comparable = t.Identifier | t.V8IntrinsicIdentifier | t.PrivateName | t.Expression
12function equal(a: Comparable, b: Comparable): boolean {
13 if (a.type !== b.type) return false
14 // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
15 switch (a.type) {
16 case 'Identifier':
17 case 'V8IntrinsicIdentifier':
18 return a.name === (b as t.Identifier).name
19 case 'PrivateName':
20 return a.id === (b as t.PrivateName).id
21 case 'MemberExpression':
22 return equal(a.object, (b as t.MemberExpression).object) &&
23 equal(a.property, (b as t.MemberExpression).property)
24 default: // other type of Expression
25 return false
26 }
27}
28
29function addNameToOptions(
30 node: t.CallExpression,

Callers 1

getTargetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…