Typed values#36
Merged
Merged
Conversation
… false upon failure to find path (to allow distinguishing of undefined--a non-allowed JSON value--from the valid JSON, null or false) and return the exact value upon falsy single results (in order to allow return of null) * Continue work on new class-based API and object-based arguments (with option to run new queries via evaluate() method without resupplying config) * Allow new preventEval=true option * Allow new callback option to allow a callback function to execute as each final result node is obtained * Support "parent" and "parentProperty" for resultType along with "all" (which also includes "path" and "value" together) * Support "." within properties * Support custom @parent, @parentProperty, @Property (in addition to custom property @path) inside evaluations * Support a custom operator ("~") to allow grabbing of property names * Fix for @path in index/property evaluations * Expose cache on JSONPath.cache for those who wish to preserve and reuse it * Expose class methods `toPathString` for converting a path as array into a (normalized) path as string and `toPathArray` for the reverse (though accepting unnormalized strings as well as normalized) * Allow ^ as property name * Update README with more examples, APIs, and better code comments; update tests * Add tests for callback, custom properties, "all" return type, properties, return (path) type, toPath * Obscure JSON.stringify fix * Add self to contributor list
…)), other fundamental JavaScript types (@null(), @object(), @array()), the JSONSchema-added type, @integer(), and the following non-JSON types that can nevertheless be used with JSONPath when querying non-JSON JavaScript objects (@undefined(), @function(), @nonfinite()). Finally, @other() is made available in conjunction with a new callback option, `otherTypeCallback`, can be used to allow user-defined type detection (at least until JSON Schema awareness may be provided).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Builds on PR #35.