MCPcopy Create free account
hub / github.com/Effect-TS/effect / JsonFromString

Function JsonFromString

packages/effect/src/unstable/schema/Model.ts:708–720  ·  view source on GitHub ↗
(
  schema: S
)

Source from the content-addressed store, hash-verified

706 * @since 4.0.0
707 */
708export const JsonFromString = <S extends Schema.Top>(
709 schema: S
710): JsonFromString<S> => {
711 const parsed = Schema.fromJsonString(Schema.toCodecJson(schema)) as any
712 return Field({
713 select: parsed,
714 insert: parsed,
715 update: parsed,
716 json: schema,
717 jsonCreate: schema,
718 jsonUpdate: schema
719 })
720}
721
722/**
723 * Variant field type for a branded binary UUID v4 value whose insert variant

Callers

nothing calls this directly

Calls 2

FieldFunction · 0.70
toCodecJsonMethod · 0.45

Tested by

no test coverage detected