(a: Comparable, b: Comparable)
| 10 | |
| 11 | type Comparable = t.Identifier | t.V8IntrinsicIdentifier | t.PrivateName | t.Expression |
| 12 | function 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 | |
| 29 | function addNameToOptions( |
| 30 | node: t.CallExpression, |
no outgoing calls
no test coverage detected
searching dependent graphs…