(ast: Objects, records: ReadonlyArray<Objects>)
| 2477 | |
| 2478 | /** @internal */ |
| 2479 | export function structWithRest(ast: Objects, records: ReadonlyArray<Objects>): Objects { |
| 2480 | if (ast.encoding || records.some((r) => r.encoding)) { |
| 2481 | throw new Error("StructWithRest does not support encodings") |
| 2482 | } |
| 2483 | let propertySignatures = ast.propertySignatures |
| 2484 | let indexSignatures = ast.indexSignatures |
| 2485 | let checks = ast.checks |
| 2486 | for (const record of records) { |
| 2487 | propertySignatures = propertySignatures.concat(record.propertySignatures) |
| 2488 | indexSignatures = indexSignatures.concat(record.indexSignatures) |
| 2489 | checks = combineChecks(checks, record.checks) |
| 2490 | } |
| 2491 | return new Objects(propertySignatures, indexSignatures, undefined, checks) |
| 2492 | } |
| 2493 | |
| 2494 | /** @internal */ |
| 2495 | export function tupleWithRest(ast: Arrays, rest: ReadonlyArray<AST>): Arrays { |
nothing calls this directly
no test coverage detected