diff --git a/lib/jsonpath-object-transform.js b/lib/jsonpath-object-transform.js index 022db64..2a9d46a 100644 --- a/lib/jsonpath-object-transform.js +++ b/lib/jsonpath-object-transform.js @@ -97,8 +97,11 @@ if (seek.length && subpath) { result = result[key] = []; - seek[0].forEach(function(item, index) { - walk(item, subpath, result, index); + var index = 0; + seek.forEach(function(item){ + item.forEach(function (item) { + walk(item, subpath, result, index++); + }); }); } else { result[key] = seek;