mirror of
https://github.com/Effect-TS/effect.git
synced 2026-12-03 03:25:40 +08:00
11 lines
330 B
TypeScript
11 lines
330 B
TypeScript
import * as Schema from "#dist/effect/Schema"
|
|
import * as SchemaValidator from "#dist/effect/SchemaValidator"
|
|
|
|
const schema = Schema.Struct({
|
|
a: Schema.String,
|
|
b: Schema.optionalKey(Schema.Number),
|
|
c: Schema.ReadonlyArray(Schema.String)
|
|
})
|
|
|
|
console.log(SchemaValidator.decodeUnknownSync(schema)({ a: "a", b: 1, c: ["c"] }))
|