Permalink
Browse files

init the array

  • Loading branch information...
1 parent b1427b1 commit f8ac2debd7567cf31e2dfcf34cfad3ebb48a765e @s3u committed Dec 2, 2011
Showing with 2 additions and 1 deletion.
  1. +1 −0 lib/jsonpath.js
  2. +1 −1 package.json
View
@@ -40,6 +40,7 @@ function jsonPath(obj, expr, arg) {
else {
if(_.isArray(v) && P.flatten) {
if(!P.result) P.result = [];
+ if(!_.isArray(P.result)) P.result = [P.result];
P.result = P.result.concat(v);
}
else {
View
@@ -16,7 +16,7 @@
"email": "mike@brevoort.com"
}
],
- "version": "0.8.4",
+ "version": "0.8.5",
"repository": {
"type": "git",
"url": "git://github.com/s3u/JSONPath.git"

0 comments on commit f8ac2de

Please sign in to comment.