Skip to content

v1.0.1

Compare
Choose a tag to compare
@aleclarson aleclarson released this 27 Oct 17:34
· 10 commits to master since this release
  • Prevent prototype pollution when decoding (i.e. throw on __proto__ key)
  • Call toJSON method (if present) when encoding
  • Remove need to escape leading hyphen in string if not followed by a digit:
     encode({ sort: '-date' })
     // v1.0.0 → "sort=\-date"
     // v1.0.1 → "sort=-date"
  • Throw on unterminated object when decoding:
     decode('a={b:{')
     // v1.0.0 → { a: { b: {} } }
     // v1.0.1 → throws "Unterminated input" error