feat: implement feature parity with jsonpath-js 0.3.0 #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added the
pathSegments()method toJsonPathmirroring the only additional feature added injsonpath-js:0.3.0.Summary of changes
Nodeclass and related functions to use an array for the path property instead of a string.JsonPathclass:paths()method to return stringified paths usingconvert_path_segment_to_stringmethod.pathSegments()method to return path segments as arrays (excluding the root).runfunction to initialize the root node path as an array.types/node.phpto work with array-based paths.TraverseDescendantTest.phpto use array paths.