flatten.js 310 B

123456789101112
  1. define(['./_flatten'], function (_flatten) {
  2. // Flatten out an array, either recursively (by default), or up to `depth`.
  3. // Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively.
  4. function flatten(array, depth) {
  5. return _flatten(array, depth, false);
  6. }
  7. return flatten;
  8. });