/* Find all items in array
495935
public function findAllItemsInArray( $in , $search ){
		
		$need = count($in);
		$find = count(array_intersect($search, $in));
		
		if($need == $find)
		{
			return TRUE;
		}
		
		return FALSE;	
	}
394239
function searchArray(list, value) {
  var index = list.indexOf(value);

  if (index === -1) return false;
  return value;
}
492671
function indexOfContainingItem(element, target) {
  const items = element.items;
  const itemCount = items ? items.length : 0;
  for (let i = 0; i < itemCount; i++) {
    let item = items[i];
    if (item === target || item.contains(target)) {
      return i;
    }
  }
  return -1;
}
1040989
function findWhere (array, obj) {
  var props = Object.keys(obj);
  for (var i = 0; i < array.length; i++) {
    var passable = true;
    for (var j = 0; j < props.length; j++) {
      if (array[i][props[j]] !== obj[props[j]]) {
        passable = false;
      }
    }
    if (passable)
      return array[i];
  }
  return null;
}
691137
public static <T> boolean containsAll(T[] array, T[] check) {
        for (T checkItem : check) {
            if (!contains(array, checkItem)) {
                return false;
            }
        }
        return true;
    }
473561
function any(arr, contition) {
  let result = false;

  util.forEach(arr, item => {
    result = contition(item);

    return !result;
  });

  return result;
}
503714
function (array, item) {
      var idx = indexOf(array, item);
      if (idx === -1) { return null; }

      return array[idx + 1];
    }
646672
function findItem( path, items ) {
  var result = null;
  items.forEach( function ( item ) {
    if (!result && item instanceof MenuItem && item.paths.filter( function( value ) {
        return value === path;
      } ).length > 0)
      result = item;
    if (!result && item instanceof MenuNode) {
      var child = findItem( path, item.children );
      if (child)
        result = child;
    }
  } );
  return result;
}
1036885
function all (data) {
    if (array(data)) {
      return testArray(data, false);
    }

    assert.object(data);

    return testObject(data, false);
  }
250983
function filter(array, f) {
        if (array) {
            var len = array.length;
            var i = 0;
            while (i < len && f(array[i]))
                i++;
            if (i < len) {
                var result = array.slice(0, i);
                i++;
                while (i < len) {
                    var item = array[i];
                    if (f(item)) {
                        result.push(item);
                    }
                    i++;
                }
                return result;
            }
        }
        return array;
    }
1235189
function find(arr, check) {
  // use native find if supported
  if (Array.prototype.find) {
    return arr.find(check);
  }

  // use `filter` to obtain the same behavior of `find`
  return arr.filter(check)[0];
}
944735
function(dir) {
      var results = [];

      var list = fs.readdirSync(dir);

      list.forEach(function(file) {
        // Check for every given pattern, regardless of whether it is an array or a string
        var matchesSomeExclude = [].concat(options.exclude).some(function(regexp) {
          return file.match(regexp) != null;
        });

        if(!matchesSomeExclude) {
          var matchesSomePattern = [].concat(options.match).some(function(regexp) {
            return file.match(regexp) != null;
          });

          file = path.resolve(dir, file);
          var stat = fs.statSync(file);

          if (stat && stat.isDirectory()) {
            if(matchesSomePattern) {
              results = results.concat(file);
            }
            results = results.concat(walk(file));
          }
        }
      });

      return results;
    }
1092116
function find(array, exp) {
  return (isArray(array) && isDefined(exp))
    //return the member and not an array like `first`
    ? findInArray(array, $parse(exp), false)
    : array;
}
388417
function findIndex (array, item) {
  return array
    .map(function (i) {
      return i.toLowerCase()
    })
    .indexOf(item.toLowerCase())
}
238950
function allSame(arr) {
    if (!check.array(arr)) {
      return false;
    }
    if (!arr.length) {
      return true;
    }
    var first = arr[0];
    return arr.every(function (item) {
      return item === first;
    });
  }
1122772
function findAll (tree, test) {
  var found = test(tree) ? [tree] : []
  if (isNode(tree)) {
    if (tree.children.length > 0) {
      tree.children.forEach(function (child) {
        found = found.concat(findAll(child, test))
      })
    }
  }

  return found
}
519013
function find(items, pred) {
  var len = items.length,
      i = -1;

  while(++i < len) {
    if (pred(items[i], i)) {
      return items[i];
    }
  }

  return null;
}