@lucid-softworks/safe-json-parse
v0.1.0
Published
Parse JSON into a Result with a stable error type.
Downloads
173
Maintainers
Readme
@lucid-softworks/safe-json-parse
Parse JSON into @lucid-softworks/result without throwing.
import { safeJsonParse } from "@lucid-softworks/safe-json-parse";
const result = safeJsonParse(input);Valid JSON produces Ok<unknown>. Invalid input produces Err<JsonParseError>;
the error retains both the original input and parser error as cause.
