This commit is contained in:
13
src/Schema/toJsonifiable.ts
Normal file
13
src/Schema/toJsonifiable.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Schema } from "@effect/schema"
|
||||
import type { JsonValue } from "type-fest"
|
||||
|
||||
|
||||
export const toJsonifiable = <
|
||||
JsonifiableA,
|
||||
JsonifiableI extends JsonValue,
|
||||
JsonifiableR,
|
||||
>(
|
||||
jsonifiableSchema: Schema.Schema<JsonifiableA, JsonifiableI, JsonifiableR>
|
||||
) =>
|
||||
<A, R>(decodedSchema: Schema.Schema<A, JsonifiableA, R>) =>
|
||||
Schema.compose(jsonifiableSchema, decodedSchema)
|
||||
Reference in New Issue
Block a user