code: function _flatten(_ref) {
    var _ref2 = _toArray(_ref);
  
    var first = _ref2[0];
  
    var rest = _ref2.slice(1);
  
    if (first === undefined) {
      return [];
    } else if (!Array.isArray(first)) {
      return [first].concat(_toConsumableArray(_flatten(rest)));
    } else {
      return [].concat(_toConsumableArray(_flatten(first)), _toConsumableArray(_flatten(rest)));
    }
  }
docs: Utility function for flattening nested arrays