Skip to content
New issue

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

Proto multiresult periodprop cb #35

Merged
merged 4 commits into from
Dec 13, 2015

Conversation

brettz9
Copy link
Collaborator

@brettz9 brettz9 commented Dec 16, 2014

Ok, it's almost just one commit. :)

If you were looking at my previous most recent pull request, this commit builds on those with a few more changes (and a fix or two, e.g., single path result), most notably:

  1. Exposing toPathString and toPathArray as public class methods
  2. Changing the new API order with the path expression before the json object, so that the arguments go from simple to complex: string->JSON object->callback function.
  3. Allow all properties (except autostart) to the evaluate() method so that configuration defaults can be overridden on a per-case basis without creating a new object.

You also may not have noticed a couple recent additions into the previous PR:

  1. The ability to execute callbacks as terminal values are obtained.
  2. A preventEval option.

This PR fixes issues #20, #22, #24, #34 , (and the preventEval option is an inadequate temporary replacement for #4 ).

… 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
This was referenced Dec 16, 2014
…ultiresult-periodprop-cb (new approach also handles periods)

# Conflicts:
#	lib/jsonpath.js
brettz9 added a commit that referenced this pull request Dec 13, 2015
@brettz9 brettz9 merged commit 6aa6ce3 into JSONPath-Plus:master Dec 13, 2015
@brettz9 brettz9 deleted the proto-multiresult-periodprop-cb branch December 13, 2015 03:47
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.

1 participant