( record: Record<string, unknown>, allowed: ReadonlySet<string>, label: string, )
| 1119 | } |
| 1120 | |
| 1121 | function assertAllowedKeys( |
| 1122 | record: Record<string, unknown>, |
| 1123 | allowed: ReadonlySet<string>, |
| 1124 | label: string, |
| 1125 | ): void { |
| 1126 | if (Object.keys(record).some((field) => !allowed.has(field))) { |
| 1127 | throw invalidProtocolFrame(`Unknown ${label} field`); |
| 1128 | } |
| 1129 | } |
| 1130 | |
| 1131 | function assertOptionalExactKeys( |
| 1132 | record: Record<string, unknown>, |
no test coverage detected