Applies changes to a JSON or JSONC file's text with jsonc-parser's
modify and applyEdits, as Vercel's setup does, so comments, key order
and formatting stay as they were. Only the text an edit inserts is
formatted, in the file's own indent (none in a one-line file), so removing
what was added gives back the same bytes. A new file is written in full. If
the edited text doesn't read back as expected, the file is written in full
instead, as Vercel's does.
Applies
changesto a JSON or JSONC file's text with jsonc-parser'smodifyandapplyEdits, as Vercel's setup does, so comments, key order and formatting stay as they were. Only the text an edit inserts is formatted, in the file's own indent (none in a one-line file), so removing what was added gives back the same bytes. A new file is written in full. If the edited text doesn't read back as expected, the file is written in full instead, as Vercel's does.