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

Suggestion: another types of result #13

Open
GoogleCodeExporter opened this issue Sep 17, 2015 · 0 comments
Open

Suggestion: another types of result #13

GoogleCodeExporter opened this issue Sep 17, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

In larger JSON framework, for jsonpath analysis
it might be usefull to have more resultTypes:

* normalized path - just steps of path as an array 
(w/out tracing target object)

if( P.resultType == "WAY" ) return P.normalize(expr).split(';');
P.trace(P.normalize(expr).replace(/^\$;/,""), obj, "$");
return P.result.length ? P.result : false;

* normalized traced path - with expanded expressions/filters/slices
asTrace: function(path) { return path.split(";"); }
store: function(p, v) { 
  if (p) P.result[P.result.length] = 
    ( P.resultType == "PATH" ? P.asPath(p) : 
    ( P.resultType == "TRACE" ? P.asTrace(p) : v));
  return !!p;
},

Original issue reported on code.google.com by [email protected] on 4 Nov 2009 at 12:19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant