Sha256: d0fd61e786c2dabb7cf65b1035a3ec1f5bd747b560af6ebc756bdb78b872e7c5

Contents?: true

Size: 823 Bytes

Versions: 157

Compression:

Stored size: 823 Bytes

Contents

"use strict";

exports.__esModule = true;

var _getIterator2 = require("../core-js/get-iterator");

var _getIterator3 = _interopRequireDefault(_getIterator2);

var _isIterable2 = require("../core-js/is-iterable");

var _isIterable3 = _interopRequireDefault(_isIterable2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

exports.default = function (arr, i) {
  if (Array.isArray(arr)) {
    return arr;
  } else if ((0, _isIterable3.default)(Object(arr))) {
    var _arr = [];

    for (var _iterator = (0, _getIterator3.default)(arr), _step; !(_step = _iterator.next()).done;) {
      _arr.push(_step.value);

      if (i && _arr.length === i) break;
    }

    return _arr;
  } else {
    throw new TypeError("Invalid attempt to destructure non-iterable instance");
  }
};

Version data entries

157 entries across 36 versions & 10 rubygems

Version Path
babel-schmooze-sprockets-0.1.2 node_modules/babel-helper-get-function-arity/node_modules/babel-runtime/helpers/slicedToArrayLoose.js
babel-schmooze-sprockets-0.1.2 node_modules/babel-helper-hoist-variables/node_modules/babel-runtime/helpers/slicedToArrayLoose.js
babel-schmooze-sprockets-0.1.2 node_modules/babel-helper-optimise-call-expression/node_modules/babel-runtime/helpers/slicedToArrayLoose.js
babel-schmooze-sprockets-0.1.2 node_modules/babel-helper-regex/node_modules/babel-runtime/helpers/slicedToArrayLoose.js
babel-schmooze-sprockets-0.1.2 node_modules/babel-helper-replace-supers/node_modules/babel-runtime/helpers/slicedToArrayLoose.js
babel-schmooze-sprockets-0.1.2 node_modules/babel-helpers/node_modules/babel-runtime/helpers/slicedToArrayLoose.js
babel-schmooze-sprockets-0.1.2 node_modules/babel-messages/node_modules/babel-runtime/helpers/slicedToArrayLoose.js
babel-schmooze-sprockets-0.1.2 node_modules/babel-plugin-check-es2015-constants/node_modules/babel-runtime/helpers/slicedToArrayLoose.js
babel-schmooze-sprockets-0.1.2 node_modules/babel-plugin-external-helpers/node_modules/babel-runtime/helpers/slicedToArrayLoose.js
babel-schmooze-sprockets-0.1.2 node_modules/babel-plugin-syntax-async-functions/node_modules/babel-runtime/helpers/slicedToArrayLoose.js
babel-schmooze-sprockets-0.1.2 node_modules/babel-plugin-transform-es2015-arrow-functions/node_modules/babel-runtime/helpers/slicedToArrayLoose.js
babel-schmooze-sprockets-0.1.2 node_modules/babel-plugin-transform-es2015-block-scoped-functions/node_modules/babel-runtime/helpers/slicedToArrayLoose.js
babel-schmooze-sprockets-0.1.2 node_modules/babel-plugin-transform-es2015-block-scoping/node_modules/babel-runtime/helpers/slicedToArrayLoose.js
babel-schmooze-sprockets-0.1.2 node_modules/babel-plugin-transform-es2015-classes/node_modules/babel-runtime/helpers/slicedToArrayLoose.js
babel-schmooze-sprockets-0.1.2 node_modules/babel-plugin-transform-es2015-computed-properties/node_modules/babel-runtime/helpers/slicedToArrayLoose.js
babel-schmooze-sprockets-0.1.2 node_modules/babel-plugin-transform-es2015-destructuring/node_modules/babel-runtime/helpers/slicedToArrayLoose.js
babel-schmooze-sprockets-0.1.2 node_modules/babel-plugin-transform-es2015-duplicate-keys/node_modules/babel-runtime/helpers/slicedToArrayLoose.js
babel-schmooze-sprockets-0.1.2 node_modules/babel-plugin-transform-es2015-for-of/node_modules/babel-runtime/helpers/slicedToArrayLoose.js
babel-schmooze-sprockets-0.1.2 node_modules/babel-plugin-transform-es2015-function-name/node_modules/babel-runtime/helpers/slicedToArrayLoose.js
babel-schmooze-sprockets-0.1.2 node_modules/babel-plugin-transform-es2015-literals/node_modules/babel-runtime/helpers/slicedToArrayLoose.js