mirror of
https://github.com/Effect-TS/effect.git
synced 2026-12-02 03:15:52 +08:00
10 lines
241 B
TypeScript
10 lines
241 B
TypeScript
import * as Schema from "#dist/Schema"
|
|
|
|
const schema = Schema.Struct({
|
|
a: Schema.String,
|
|
b: Schema.optional(Schema.Number),
|
|
c: Schema.Array(Schema.String)
|
|
})
|
|
|
|
console.log(Schema.decodeUnknownEither(schema)({ a: "a", b: 1, c: ["c"] }))
|