( path: unknown, key: TypeFilter<V>, )
| 50 | } |
| 51 | |
| 52 | export function unwrapPath<V extends t.Node>( |
| 53 | path: unknown, |
| 54 | key: TypeFilter<V>, |
| 55 | ): babel.NodePath<V> | undefined { |
| 56 | if (isPathValid(path, key)) { |
| 57 | return path; |
| 58 | } |
| 59 | if (isPathValid(path, isNestedExpression)) { |
| 60 | return unwrapPath(path.get("expression"), key); |
| 61 | } |
| 62 | return undefined; |
| 63 | } |
no test coverage detected