Minor Changes
-
#274
eae1614
Thanks @gcanti! - remove getPropertySignatures API (see #271) -
#274
eae1614
Thanks @gcanti! - rename AST.getTo -> to, AST.getFrom -> from
p.s.
Here's how to define getPropertySignatures
in userland:
import * as AST from '@effect/schema/AST'
import { Schema, make } from '@effect/schema/Schema'
export const getPropertySignatures = <I extends { [K in keyof A]: any }, A>(
schema: Schema<I, A>
): { [K in keyof A]: Schema<I[K], A[K]> } => {
const out: Record<PropertyKey, Schema<any>> = {}
const propertySignatures = AST.getPropertySignatures(schema.ast)
for (let i = 0; i < propertySignatures.length; i++) {
const propertySignature = propertySignatures[i]
out[propertySignature.name] = make(propertySignature.type)
}
return out as any
}