github Effect-TS/schema v0.18.0

latest releases: v0.56.1, v0.56.0, v0.55.0...
16 months ago

Minor Changes

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
}

Don't miss a new schema release

NewReleases is sending notifications on new releases.