Function
struct
(
fields: Fields,
checks: Checks | undefined,
annotations?: Schema.Annotations.Annotations
)
Source from the content-addressed store, hash-verified
| 2439 | |
| 2440 | /** @internal */ |
| 2441 | export function struct<Fields extends Schema.Struct.Fields>( |
| 2442 | fields: Fields, |
| 2443 | checks: Checks | undefined, |
| 2444 | annotations?: Schema.Annotations.Annotations |
| 2445 | ): Objects { |
| 2446 | return new Objects( |
| 2447 | Reflect.ownKeys(fields).map((key) => { |
| 2448 | return new PropertySignature(key, fields[key].ast) |
| 2449 | }), |
| 2450 | [], |
| 2451 | annotations, |
| 2452 | checks |
| 2453 | ) |
| 2454 | } |
| 2455 | |
| 2456 | /** @internal */ |
| 2457 | export function getAST<S extends { readonly ast: AST }>(self: S): S["ast"] { |
Callers
nothing calls this directly
Tested by
no test coverage detected