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

Function fromJsonString

packages/effect/src/Schema.ts:9836–9845  ·  view source on GitHub ↗
(
  schema: S,
  options?: {
    readonly reviver?: Parameters<typeof JSON.parse>[1] | undefined
    readonly replacer?: SchemaGetter.JsonReplacer | undefined
    readonly space?: Parameters<typeof JSON.stringify>[2] | undefined
  }
)

Source from the content-addressed store, hash-verified

9834 * @since 4.0.0
9835 */
9836export function fromJsonString<S extends Constraint>(
9837 schema: S,
9838 options?: {
9839 readonly reviver?: Parameters<typeof JSON.parse>[1] | undefined
9840 readonly replacer?: SchemaGetter.JsonReplacer | undefined
9841 readonly space?: Parameters<typeof JSON.stringify>[2] | undefined
9842 }
9843): fromJsonString<S> {
9844 return JsonString.pipe(decodeTo(schema, SchemaTransformation.fromJsonString(options)))
9845}
9846/** @internal */
9847export const UnknownFromJsonString: fromJsonString<Unknown> = fromJsonString(Unknown)
9848/**

Callers 2

Schema.tsFile · 0.70
JsonFromUrlParamsFieldFunction · 0.70

Calls 2

decodeToFunction · 0.70
pipeMethod · 0.65

Tested by

no test coverage detected