Skip to content

Releases: janl/node-jsonpointer

Version 5.0.1

13 Jul 12:48
Compare
Choose a tag to compare

Changelog

  • Fix incorrect typings for compile get/set methods (#58, thanks to @haakemon)
  • Fix null values throwing exception when traversing over while getting (#50, thanks to @reckter)
  • Fix tests for null and undefined assertions (a5706e8)

v5.0.0

12 Nov 18:49
Compare
Choose a tag to compare

5.0.0 (2021-10-31)

Bug Fixes

  • Fix prototype pollution (#51)

    • The original, non-mutated objects are now returned if any of the keys __proto__, constructor or prototype are used in a json pointer.
    // returns the unmodified input {}
    jsonpointer.set({}, '/foo/__proto__/boo', 'polluted')
    • When passing non-string arrays to a .set operation, an error is thrown:
    // throws `new Error('Invalid JSON pointer. Must be of type string or number.')`
    jsonpointer.set({}, [['__proto__'], ['__proto__'], 'boo'], 'polluted')

v4.1.0

03 Jul 10:35
Compare
Choose a tag to compare

4.1.0 (2020-07-03)

Bug Fixes

Features

Version 4.0.1

21 Dec 13:33
37c73ae
Compare
Choose a tag to compare

Whitelist production relevant files in package.json.
This decreases the npm package size a bit.
#26

Version 4.0.0

19 May 09:54
2d46030
Compare
Choose a tag to compare
  • null values now get set properly
  • deleting a property is now supported by using jsonpointer.set(obj, '/val', undefined)

BREAKING CHANGES

setting null values

When setting a null value, it now gets set as actual value.
Previously we've deleted the property.

var obj = {foo: 'bar'}
jsonpointer.set(obj, '/foo', null)
// results in obj = {foo: null}

empty values

When getting a non-existent value, we previously returned null.
We've now changed that to undefined.

var obj = {}
jsonpointer.get(obj, '/foo')
// returns `undefined`
// with earlier versions, we've returned `null`

Version 3.0.1

19 May 07:25
bc72857
Compare
Choose a tag to compare

Split getter & setter to improve readability and improve the performance

Version 3.0.0

29 Sep 23:33
Compare
Choose a tag to compare
  • Support /- getter and setter and nested properties #19
  • Add jsonpointer.compile(pointer) feature #20
  • Lint files, use JavaScript standard style #23
  • Drop node 0.6 and 0.8 support

Version 2.0.0

26 May 20:33
Compare
Choose a tag to compare
  • Remove unused console module #18
  • Throw Error instances instead of strings #12

1.1.0

18 May 20:47
Compare
Choose a tag to compare
Merge pull request #9 from hildjj/master

Return null when value not found

1.0.1

18 May 20:48
Compare
Choose a tag to compare
1.0.1