(expr: unknown)
| 197 | } |
| 198 | |
| 199 | function toPropRef(expr: unknown): PropRef | undefined { |
| 200 | if (expr instanceof PropRef) { |
| 201 | return expr |
| 202 | } |
| 203 | if ( |
| 204 | expr && |
| 205 | typeof expr === `object` && |
| 206 | `type` in expr && |
| 207 | (expr as { type?: string }).type === `ref` && |
| 208 | Array.isArray((expr as { path?: unknown }).path) |
| 209 | ) { |
| 210 | return new PropRef((expr as unknown as { path: Array<string> }).path) |
| 211 | } |
| 212 | return undefined |
| 213 | } |
no outgoing calls
no test coverage detected