API reference › @evolu/common › Type › Json
const Json: brand(
"Json",
String,
(value) => {
const result = jsonToJsonValueResult(value);
return result.ok ? ok() : result;
},
(error) =>
The value ${safelyStringifyUnknownValue(error.value)} cannot be parsed into a JsonValue.,
) ;
Defined in: packages/common/src/Type.ts:14242
A String Brand proving that its exact text parses to JsonValue.
The Brand preserves whitespace, property order, and number spelling. Convert it to JsonValue through JsonValueFromJson or jsonToJsonValue.