summaryrefslogtreecommitdiff
path: root/bin/wiki/ImportarDesdeURL/node_modules/lodash/flattenDepth.js
diff options
context:
space:
mode:
Diffstat (limited to 'bin/wiki/ImportarDesdeURL/node_modules/lodash/flattenDepth.js')
-rw-r--r--bin/wiki/ImportarDesdeURL/node_modules/lodash/flattenDepth.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/bin/wiki/ImportarDesdeURL/node_modules/lodash/flattenDepth.js b/bin/wiki/ImportarDesdeURL/node_modules/lodash/flattenDepth.js
new file mode 100644
index 00000000..441fdcc2
--- /dev/null
+++ b/bin/wiki/ImportarDesdeURL/node_modules/lodash/flattenDepth.js
@@ -0,0 +1,33 @@
+var baseFlatten = require('./_baseFlatten'),
+ toInteger = require('./toInteger');
+
+/**
+ * Recursively flatten `array` up to `depth` times.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.4.0
+ * @category Array
+ * @param {Array} array The array to flatten.
+ * @param {number} [depth=1] The maximum recursion depth.
+ * @returns {Array} Returns the new flattened array.
+ * @example
+ *
+ * var array = [1, [2, [3, [4]], 5]];
+ *
+ * _.flattenDepth(array, 1);
+ * // => [1, 2, [3, [4]], 5]
+ *
+ * _.flattenDepth(array, 2);
+ * // => [1, 2, 3, [4], 5]
+ */
+function flattenDepth(array, depth) {
+ var length = array == null ? 0 : array.length;
+ if (!length) {
+ return [];
+ }
+ depth = depth === undefined ? 1 : toInteger(depth);
+ return baseFlatten(array, depth);
+}
+
+module.exports = flattenDepth;