API reference / @evolu/common / Type / Json

Variable: Json

const Json: BrandType<
  Type<"String", string, string, StringError, string, StringError>,
  "Json",
  JsonError,
  StringError
>;

Defined in: packages/common/src/Type.ts:3547

JSON-string Type.

Example

const result = Json.from('{"key":"value"}'); // ok
const error = Json.from("invalid json"); // err

Was this page helpful?