StaticparseParses JSON with line and block comments.
Comments are replaced with whitespace before the native JSON.parse is called, retaining their exact source offsets in parse errors.
The optional reviver is passed through unchanged.
JSONC source text to parse.
Optionalreviver: (this: any, key: string, value: any) => any
Optional native JSON reviver.
Parsed JSON value.
SyntaxError - When the source text is not valid JSONC.
StaticstripRemoves line and block comments from JSONC source text.
Clean mode removes comment-only lines and preceding horizontal whitespace. Preserve mode replaces comment characters with spaces while retaining the exact length and line-break offsets of the source text.
JSONC source text.
Comment removal mode. Defaults to "clean".
Strict JSON source text if the input was otherwise valid JSON.
SyntaxError - When a block comment is not terminated.
JSON-compatible parser and comment stripper.