toConsumableArray.js 210 B

123456789
  1. export default (function (arr) {
  2. if (Array.isArray(arr)) {
  3. for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
  4. return arr2;
  5. } else {
  6. return Array.from(arr);
  7. }
  8. });