(schema: unknown, fieldName: string)
| 73 | } |
| 74 | |
| 75 | function lookupField(schema: unknown, fieldName: string): unknown | undefined { |
| 76 | if (typeof schema !== 'object' || schema === null) return undefined |
| 77 | const typed = schema as Record<string, unknown> |
| 78 | |
| 79 | if (fieldName in typed) { |
| 80 | return typed[fieldName] |
| 81 | } |
| 82 | |
| 83 | const props = getProperties(schema) |
| 84 | if (props && fieldName in props) { |
| 85 | return props[fieldName] |
| 86 | } |
| 87 | |
| 88 | return undefined |
| 89 | } |
| 90 | |
| 91 | function isOpaqueSchemaNode(value: unknown): boolean { |
| 92 | const node = asSchemaNode(value) |
no test coverage detected