objx icon indicating copy to clipboard operation
objx copied to clipboard

Rewrite Accessor to fix array access issues, also add a Delete method

Open Niels-Be opened this issue 1 year ago • 1 comments

Summary

This is a rewrite of the accessor code to fix a lot of issues with access to arrays.

I added some tests that were failing bevor this rewrite.

There should be no breaking changes with this code. However the new code could allow errors to be forwarded to the caller. e.g. for Get() to differentiate between not found and json null value. Or to notify the caller about an invalid path expression.

Maybe add new methods for this?

In this PR all errors are just swallowed to keep compatibility.

Additionally a new Delete method (as requested in #141) is introduced which was trivial to add with the new code.

Checklist

  • [x] Tests are passing: task test
  • [x] Code style is correct: task lint

Niels-Be avatar Aug 27 '23 11:08 Niels-Be