MCPcopy Create free account
hub / github.com/Effect-TS/effect / structWithRest

Function structWithRest

packages/effect/src/SchemaAST.ts:2479–2492  ·  view source on GitHub ↗
(ast: Objects, records: ReadonlyArray<Objects>)

Source from the content-addressed store, hash-verified

2477
2478/** @internal */
2479export 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 */
2495export function tupleWithRest(ast: Arrays, rest: ReadonlyArray<AST>): Arrays {

Callers

nothing calls this directly

Calls 2

someMethod · 0.80
combineChecksFunction · 0.70

Tested by

no test coverage detected