( node: Node | null | undefined, test: string | ((id: string) => boolean) | null | undefined, )
| 39 | } |
| 40 | |
| 41 | export function isCallOf( |
| 42 | node: Node | null | undefined, |
| 43 | test: string | ((id: string) => boolean) | null | undefined, |
| 44 | ): node is CallExpression { |
| 45 | return !!( |
| 46 | node && |
| 47 | test && |
| 48 | node.type === 'CallExpression' && |
| 49 | node.callee.type === 'Identifier' && |
| 50 | (typeof test === 'string' |
| 51 | ? node.callee.name === test |
| 52 | : test(node.callee.name)) |
| 53 | ) |
| 54 | } |
| 55 | |
| 56 | export function toRuntimeTypeString(types: string[]): string { |
| 57 | return types.length > 1 ? `[${types.join(', ')}]` : types[0] |
no test coverage detected