We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It seems that in some cases obligatoryProps does not work correctly if there is no * in the path.
obligatoryProps
*
Steps to reproduce:
example.org#%#//scriptlet('json-prune', 'whatever.qwerty advert', 'path.not.exist')
const jsonObj = '{"advert":"hello","foo":{"bar":1}}'; const test = JSON.parse(jsonObj); console.debug('test.advert:', test.advert);
advert should not be removed and test.advert should returns hello, because there is no path.not.exist in JSON object.
advert
test.advert
hello
path.not.exist
But, currently advert is removed and test.advert returns undefined.
Rule like this:
example.org#%#//scriptlet('json-prune', 'whatever.qwerty advert', '*.not.exist')
works correctly.
The text was updated successfully, but these errors were encountered:
AG-24527 Fix 'json-prune' — obligatoryProps and stack trace. #345 #348
5f4949d
Squashed commit of the following: commit 38f0da2 Author: Slava Leleka <v.leleka@adguard.com> Date: Thu Aug 10 13:22:40 2023 +0300 Update test description commit 4c9356b Author: Slava Leleka <v.leleka@adguard.com> Date: Thu Aug 10 13:22:08 2023 +0300 Update test description commit 15b3d7c Merge: 0e3b35c 1b81a02 Author: Adam Wróblewski <adam@adguard.com> Date: Thu Aug 10 11:08:30 2023 +0200 Merge branch 'master' into fix/AG-24527 commit 0e3b35c Merge: 31d149d 975ad11 Author: Adam Wróblewski <adam@adguard.com> Date: Fri Aug 4 14:49:41 2023 +0200 Merge branch 'master' into fix/AG-24527 commit 31d149d Author: Adam Wróblewski <adam@adguard.com> Date: Thu Aug 3 16:24:50 2023 +0200 Fix issue with stack and obligatoryProps in json-prune
slavaleleka
No branches or pull requests
It seems that in some cases
obligatoryProps
does not work correctly if there is no*
in the path.Steps to reproduce:
advert
should not be removed andtest.advert
should returnshello
, because there is nopath.not.exist
in JSON object.But, currently
advert
is removed andtest.advert
returns undefined.Screenshot
Rule like this:
works correctly.
Screenshot
The text was updated successfully, but these errors were encountered: