(obj: unknown, key: string)
| 568 | } |
| 569 | |
| 570 | function field(obj: unknown, key: string): unknown { |
| 571 | return isRecord(obj) ? obj[key] : undefined; |
| 572 | } |
| 573 | |
| 574 | function isRecord(value: unknown): value is Record<string, unknown> { |
| 575 | return typeof value === "object" && value !== null; |
no test coverage detected