UNPKG

jsonrepair

Version:
18 lines 463 B
/** * Repair a string containing an invalid JSON document. * For example changes JavaScript notation into JSON notation. * * Example: * * try { * const json = "{name: 'John'}" * const repaired = jsonrepair(json) * console.log(repaired) * // '{"name": "John"}' * } catch (err) { * console.error(err) * } * */ export declare function jsonrepair(text: string): string; //# sourceMappingURL=jsonrepair.d.ts.map