import { parse } from "https://deno.land/std@0.218.0/jsonc/parse.ts";
Converts a JSON with Comments (JSONC) string into an object.
If a syntax error is found, throw a SyntaxError
.
Examples
Example 1
Example 1
import { parse } from "https://deno.land/std@0.218.0/jsonc/mod.ts";
parse('{"foo": "bar", } // comment'); // { foo: "bar" }
parse('{"foo": "bar", } /* comment *\/'); // { foo: "bar" }
parse('{"foo": "bar" } // comment', {
allowTrailingComma: false,
}); // { foo: "bar" }
Parameters
optional
unnamed 1: ParseOptions = [UNSUPPORTED]