Parse a JSONC (JSON with Comments) string into a JavaScript value.
Supports both single-line (//) and block comments (/* ... */), as well as trailing commas in objects and arrays.
function
Parse a JSONC (JSON with Comments) string into a JavaScript value.
Supports both single-line (//) and block comments (/* ... */), as well as trailing commas in objects and arrays.
The JSONC string to parse
A JavaScript value
const result = Bun.JSONC.parse(`{
// This is a comment
"name": "my-app",
"version": "1.0.0", // trailing comma is allowed
}`);