function / @typed/router/Path

schemaFromFields

Builds an Effect Schema record from required and optional route fields.

Package version
1.0.0-beta.13
Category
Parameter schemas
Since
1.0.0

Import

import { schemaFromFields } from "@typed/router/Path";

Signatures

export declare function schemaFromFields({ requiredFields, optionalFields }: SchemaFields): Schema.Top;

Why

All route-derived records apply the same required/optional construction rules.

Ownership and lifetime

schemaFromFields constructs and returns immutable Effect Schema values immediately. Any services are required later by the Effect that executes those Schemas.

Source