Skip to content

client9/jsonrx

Repository files navigation

jsonrx

Convert alternative JSON formats back to spec so you can get on with your life.

WIP -- Not quite ready!

The public API of Decode and DecodeAppend are stable and works.

  • However a lot more work needs to be done on error cases. Row/Collum numbers on errors are likely wrong

What does it do?

  • Remove trailing commas (JSON5, JWCC, HuJSON)
  • Remove leading commas ( cut-n-paste errors)
  • Convert hexadecimal literals to normal base10 integers (JSON5)
  • Ensure object key names are double quoted (JSON5)
  • Convert single-quoted strings to double quoted JSON.
  • Convert backtick string to double quoted JSON strings.
  • Convert multiline end-of-line escapes (backslash at end of line).
  • Remove single line '//' comments (C/Java/Go single line)(JSON5, JWCC, HuJSON)
  • Remove multiline '/* ... */' comments (JSON5, JWCC, HuJSON)
  • Remove shell-style # single line comments
  • Remove '+' sign from integers (JSON5)
  • Remove leading zeros from numbers, e.g. "01"
  • Normalize floats ".5" to "0.5", "5." to "5"
  • Convert [+/-]Infinity [+/-]2^53 -1 (largest/smallest possible integer)
  • Normalize string escape sequences (mostly done)
  • Convert NaN forms ... (coming soon)
  • Convert \x?? hex escapes
  • Convert "\r\n" to "\n"

Supported JSON Variants

Additional Reading

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published