( record: Record<string, unknown>, label: string, required: readonly string[], optional: readonly string[], )
| 1129 | } |
| 1130 | |
| 1131 | function assertOptionalExactKeys( |
| 1132 | record: Record<string, unknown>, |
| 1133 | label: string, |
| 1134 | required: readonly string[], |
| 1135 | optional: readonly string[], |
| 1136 | ): void { |
| 1137 | requireFields(record, required); |
| 1138 | assertAllowedKeys(record, new Set([...required, ...optional]), label); |
| 1139 | } |
| 1140 | |
| 1141 | function assertJsonBytes(value: unknown, maxBytes: number, label: string): void { |
| 1142 | if (Buffer.byteLength(JSON.stringify(value), 'utf8') > maxBytes) { |
no test coverage detected