Version 1
[yaffs-website] / node_modules / uncss / node_modules / lodash / dropWhile.js
diff --git a/node_modules/uncss/node_modules/lodash/dropWhile.js b/node_modules/uncss/node_modules/lodash/dropWhile.js
new file mode 100644 (file)
index 0000000..0e884f0
--- /dev/null
@@ -0,0 +1,44 @@
+var baseIteratee = require('./internal/baseIteratee'),
+    baseWhile = require('./internal/baseWhile');
+
+/**
+ * Creates a slice of `array` excluding elements dropped from the beginning.
+ * Elements are dropped until `predicate` returns falsey. The predicate is
+ * invoked with three arguments: (value, index, array).
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * var users = [
+ *   { 'user': 'barney',  'active': false },
+ *   { 'user': 'fred',    'active': false },
+ *   { 'user': 'pebbles', 'active': true }
+ * ];
+ *
+ * _.dropWhile(users, function(o) { return !o.active; });
+ * // => objects for ['pebbles']
+ *
+ * // using the `_.matches` iteratee shorthand
+ * _.dropWhile(users, { 'user': 'barney', 'active': false });
+ * // => objects for ['fred', 'pebbles']
+ *
+ * // using the `_.matchesProperty` iteratee shorthand
+ * _.dropWhile(users, ['active', false]);
+ * // => objects for ['pebbles']
+ *
+ * // using the `_.property` iteratee shorthand
+ * _.dropWhile(users, 'active');
+ * // => objects for ['barney', 'fred', 'pebbles']
+ */
+function dropWhile(array, predicate) {
+  return (array && array.length)
+    ? baseWhile(array, baseIteratee(predicate, 3), true)
+    : [];
+}
+
+module.exports = dropWhile;