( property: 'text' | 'attrs', selector: string, result: DirectIosSelectorQueryResult, )
| 392 | } |
| 393 | |
| 394 | function buildDirectIosGetResult( |
| 395 | property: 'text' | 'attrs', |
| 396 | selector: string, |
| 397 | result: DirectIosSelectorQueryResult, |
| 398 | ): Record<string, unknown> | null { |
| 399 | if (!result.found || !result.node) return null; |
| 400 | const base = { |
| 401 | target: { kind: 'selector' as const, selector }, |
| 402 | node: result.node, |
| 403 | selectorChain: [selector], |
| 404 | }; |
| 405 | if (property === 'attrs') return { kind: 'attrs', ...base }; |
| 406 | if (typeof result.text !== 'string') return null; |
| 407 | return { kind: 'text', ...base, text: result.text }; |
| 408 | } |
| 409 | |
| 410 | function buildDirectIosIsResult( |
| 411 | predicate: Exclude<IsPredicate, 'exists' | 'hidden'>, |
no outgoing calls
no test coverage detected