import { parse } from 'zerteiler';
import { z } from "zod";
const schema = z.object({
path: z.string(),
content: z.string(),
});
const invalidJsonString = `{\"path\": \"// This is a comment \nconst content = {"test": "value"} `;
const validJSON = parse(invalidJsonString, schema)
console.log(validJSON){ "path": `// This is a comment \nconst content = {"test": "value"} `, "content": null}
npm install zerteiler
This project is licensed under the terms of the MIT license. See the LICENSE file for details.