aboutsummaryrefslogtreecommitdiff
path: root/node_modules/lodash/_lazyReverse.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/lodash/_lazyReverse.js')
-rw-r--r--node_modules/lodash/_lazyReverse.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/node_modules/lodash/_lazyReverse.js b/node_modules/lodash/_lazyReverse.js
new file mode 100644
index 0000000..c5b5219
--- /dev/null
+++ b/node_modules/lodash/_lazyReverse.js
@@ -0,0 +1,23 @@
+var LazyWrapper = require('./_LazyWrapper');
+
+/**
+ * Reverses the direction of lazy iteration.
+ *
+ * @private
+ * @name reverse
+ * @memberOf LazyWrapper
+ * @returns {Object} Returns the new reversed `LazyWrapper` object.
+ */
+function lazyReverse() {
+ if (this.__filtered__) {
+ var result = new LazyWrapper(this);
+ result.__dir__ = -1;
+ result.__filtered__ = true;
+ } else {
+ result = this.clone();
+ result.__dir__ *= -1;
+ }
+ return result;
+}
+
+module.exports = lazyReverse;