跳到主要内容

std/build/json

std/build/json

Type Aliases

JsonPatchOperation

type JsonPatchOperation = Schema.Schema.Type<typeof JsonPatchOperationSchema>;

Defined in: apps/website/.api-docs-entry/std/build/json/index.d.ts:13

Variables

JsonPatchOperationSchema

const JsonPatchOperationSchema: Schema.Struct<{
  op: Schema.Literals<readonly ["add", "remove", "replace"]>;
  path: Schema.String;
  value: Schema.optional<Schema.Unknown>;
}>;

Defined in: apps/website/.api-docs-entry/std/build/json/index.d.ts:8

One mutation in a JSON Patch document, as deepDiff and the form engine's delta carry it.

The wire shape has one schema owner so both producers and consumers agree on the op names — a move or copy op drifts out of the form engine's vocabulary and back in as a misapplied diff.

Functions

deepDiff()

function deepDiff(
   a,
   b,
   basePath?): object[];

Defined in: apps/website/.api-docs-entry/std/build/json/index.d.ts:22

Parameters

Parameter Type
a unknown
b unknown
basePath? string

Returns

object[]


safeParse()

function safeParse(json): unknown;

Defined in: apps/website/.api-docs-entry/std/build/json/index.d.ts:21

Parse a JSON string, returning null on failure.

Returns unknown — callers must decode the result with an Effect Schema before treating it as a concrete type. This is the unvalidated boundary parse; structured validation belongs at the call site.

Parameters

Parameter Type
json string

Returns

unknown