(objectExpression: any, propertyName: string)
| 750 | } |
| 751 | |
| 752 | function getObjectPropertyValueNode(objectExpression: any, propertyName: string): any | null { |
| 753 | for (const property of objectExpression?.properties ?? []) { |
| 754 | if (property?.type !== "Property" && property?.type !== "ObjectProperty") continue; |
| 755 | const keyName = |
| 756 | property.key?.type === "Identifier" |
| 757 | ? property.key.name |
| 758 | : property.key?.type === "StringLiteral" || property.key?.type === "Literal" |
| 759 | ? String(property.key.value ?? "") |
| 760 | : null; |
| 761 | if (keyName === propertyName) { |
| 762 | return property.value ?? null; |
| 763 | } |
| 764 | } |
| 765 | return null; |
| 766 | } |
| 767 | |
| 768 | function resolveVariableDeclaratorByName(j: any, root: any, name: string): any | null { |
| 769 | const matches = root.find(j.VariableDeclarator, { |
no outgoing calls
no test coverage detected