This commit is contained in:
@@ -1,16 +0,0 @@
|
|||||||
import { Schema } from "@effect/schema"
|
|
||||||
import type { Jsonifiable as TJsonifiable } from "type-fest"
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Use `makeJsonifiable` instead
|
|
||||||
*/
|
|
||||||
export const Jsonifiable = <
|
|
||||||
JsonifiableA,
|
|
||||||
JsonifiableI extends TJsonifiable,
|
|
||||||
JsonifiableR,
|
|
||||||
>(
|
|
||||||
jsonifiable: Schema.Schema<JsonifiableA, JsonifiableI, JsonifiableR>
|
|
||||||
) =>
|
|
||||||
<A, R>(schema: Schema.Schema<A, JsonifiableA, R>) =>
|
|
||||||
jsonifiable.pipe(Schema.compose(schema))
|
|
||||||
13
src/Schema/composeJsonifiable.ts
Normal file
13
src/Schema/composeJsonifiable.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { Schema } from "@effect/schema"
|
||||||
|
import type { JsonValue } from "type-fest"
|
||||||
|
|
||||||
|
|
||||||
|
export const composeJsonifiable = <
|
||||||
|
JsonifiableA,
|
||||||
|
JsonifiableI extends JsonValue,
|
||||||
|
JsonifiableR,
|
||||||
|
>(
|
||||||
|
jsonifiableSchema: Schema.Schema<JsonifiableA, JsonifiableI, JsonifiableR>
|
||||||
|
) =>
|
||||||
|
<A, R>(decodedSchema: Schema.Schema<A, JsonifiableA, R>) =>
|
||||||
|
Schema.compose(jsonifiableSchema, decodedSchema)
|
||||||
@@ -1,9 +1,8 @@
|
|||||||
export * from "./Class"
|
export * from "./Class"
|
||||||
|
export * from "./composeJsonifiable"
|
||||||
export * from "./DateTime"
|
export * from "./DateTime"
|
||||||
export * from "./encodedAsPrismaJsonValue"
|
export * from "./encodedAsPrismaJsonValue"
|
||||||
export * from "./Jsonifiable"
|
|
||||||
export * from "./Kind"
|
export * from "./Kind"
|
||||||
export * from "./makeJsonifiable"
|
|
||||||
export * as MobX from "./MobX"
|
export * as MobX from "./MobX"
|
||||||
export * from "./MutableClass"
|
export * from "./MutableClass"
|
||||||
export * from "./MutableTaggedClass"
|
export * from "./MutableTaggedClass"
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
import { Schema } from "@effect/schema"
|
|
||||||
import type { JsonValue } from "type-fest"
|
|
||||||
|
|
||||||
|
|
||||||
export const makeJsonifiable = <
|
|
||||||
JsonifiableA,
|
|
||||||
JsonifiableI extends JsonValue,
|
|
||||||
JsonifiableR,
|
|
||||||
>(
|
|
||||||
jsonifiable: Schema.Schema<JsonifiableA, JsonifiableI, JsonifiableR>
|
|
||||||
) =>
|
|
||||||
<A, R>(schema: Schema.Schema<A, JsonifiableA, R>) =>
|
|
||||||
jsonifiable.pipe(Schema.compose(schema))
|
|
||||||
Reference in New Issue
Block a user