Skip to content

Conversation

@nalundgaard
Copy link
Owner

Resolves #42.

Problem

when calling jsn:delete/2 on a path to an object where the value is itself an object, jsn doesn't delete the object due to incorrect guards in the handling of deletion for nested paths: the guard does not work when there isn't a nested path element to walk into, leaving the leaf object.

Solution

Fix the guard and update the tests.

Resolves #42.

**Problem**

when calling `jsn:delete/2` on a path to an object where the value is itself an object, `jsn` doesn't delete the object due to incorrect guards in the handling of deletion for nested paths: the guard does not work when there *isn't* a nested path element to walk into, leaving the leaf object.

**Solution**

Fix the guard and update the tests.
@nalundgaard nalundgaard merged commit 606c63d into master Mar 29, 2022
@nalundgaard nalundgaard deleted the issue_42 branch March 29, 2022 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

delete/2 cannot delete empty path

3 participants