mirror of
https://github.com/Effect-TS/effect.git
synced 2026-11-27 02:25:36 +08:00
13 lines
344 B
TypeScript
13 lines
344 B
TypeScript
import * as Effect from "#dist/effect/Effect"
|
|
import * as Schema from "#dist/effect/Schema"
|
|
|
|
const schema = Schema.toCodecStringTree(Schema.Struct({
|
|
a: Schema.String,
|
|
b: Schema.optional(Schema.FiniteFromString),
|
|
c: Schema.Array(Schema.String)
|
|
}))
|
|
|
|
Schema.decodeUnknownEffect(schema)({ a: "a", b: "1", c: ["c"] }).pipe(
|
|
Effect.runFork
|
|
)
|