Closed warpech closed 9 years ago
Here is the new branch: https://github.com/Starcounter-Jack/JSON-Patch/tree/issues/73
The exception name is OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED
, I added OPERATION_
to match all other exceptions and removed _OBJECT
to shorten it somehow.
Three new validation specs added:
should return an error if an "add" operation "value" contains "undefined"
should return an error if a "replace" operation "value" contains "undefined"
should return an error if a "test" operation "value" contains "undefined"
with the following operation values:
{ foo: undefined }
{ foos: [undefined] }
{ foo: { bars: [undefined] }} }
@tomalec can you review?
Check itself LGTM, but we need that change to be made in .ts
files as well.
Updated .ts
files. How do you test TypeScript? There is nothing about it in the project.
U should use tsc
in command-line to generate js out of ts, then test js ;)
@tomalec thanks, tested.
cool, can you merge it to the master, and close the issue?
Done. Released 0.5.3
version.
(Continued from https://github.com/PuppetJs/PuppetJs/issues/21)
PuppetJs in debug mode (currently ON by default) validates outgoing patches:
in which case the error should be reported. I am glad that we both agree :)
It should not be mixed. The current check for
undefined
value (OPERATION_VALUE_REQUIRED
) should be kept. A new check forundefined
property of the value (if the value is an object) should be added after it (VALUE_OBJECT_CANNOT_CONTAIN_UNDEFINED
).@miyconst could you prepare a solution for this on a separate branch in https://github.com/Starcounter-Jack/JSON-Patch? Publish code on a separate branch for review. The changes should include test and update to README.md