0.1.11 #12

Merged
Thilawyn merged 13 commits from next into master 2024-08-20 22:17:43 +02:00
2 changed files with 14 additions and 0 deletions
Showing only changes of commit c5417454df - Show all commits

View File

@@ -3,6 +3,7 @@ export * from "./DateTime"
export * from "./encodedAsJsonValue"
export * from "./Jsonifiable"
export * from "./Kind"
export * from "./makeJsonifiable"
export * as MobX from "./MobX"
export * from "./MutableClass"
export * from "./MutableTaggedClass"

View File

@@ -0,0 +1,13 @@
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))