(node)
| 66 | } |
| 67 | |
| 68 | export function getStringValue(node) { |
| 69 | const expression = unwrapExpression(node); |
| 70 | if (expression?.type === "Literal" && typeof expression.value === "string") |
| 71 | return expression.value; |
| 72 | if (expression?.type === "StringLiteral") return expression.value; |
| 73 | return undefined; |
| 74 | } |
| 75 | |
| 76 | export function isIdentifier(node, name) { |
| 77 | return node?.type === "Identifier" && (name === undefined || node.name === name); |
no test coverage detected