Skip to content

Enhancements and bug fixes

Compare
Choose a tag to compare
@alshakero alshakero released this 01 Apr 12:39
· 144 commits to master since this release
  • applyOperation and applyReducer now accept an optional index parameter. This param is used to create more elaborate error messages when invalid operations occur in your patches, #221.

  • Error messages are now nicely-formatted, they look like:

	The specified index MUST NOT be greater than the number of elements in the array
    name: OPERATION_VALUE_OUT_OF_BOUNDS
    index: 1
    operation: {
      "op": "add",
      "path": "/root/1",
      "value": "val"
    }
    tree: {
      "root": []
    }"
  • By default, prototype injection is not allowed and throws an error. If you want to pollute a prototype, you'll need to pass a flag banPrototypeModifications = false to all applyX functions. #219.
  • Bad behaviour when you replace an object with an array is now fixed. See #205.