Skip to content
Browse files

array select

  • Loading branch information...
1 parent b52f5a6 commit efa7355d8b746ca05d421c8c008b5c6ec0a4a8d5 @substack committed Jul 13, 2013
Showing with 5 additions and 0 deletions.
  1. +5 −0 index.js
View
5 index.js
@@ -11,6 +11,11 @@ module.exports = function pathway (obj, path) {
else if (isRegExp(p)) {
return withFilter(nodes, function (key) { return p.test(key) })
}
+ else if (Array.isArray(p)) {
+ return withFilter(nodes, function (key) {
+ return p.indexOf(key) >= 0;
+ });
+ }
else {
return concatMap(nodes, function (node, ix) {
if (!node[p]) return [];

0 comments on commit efa7355

Please sign in to comment.
Something went wrong with that request. Please try again.