UNPKG

347 BJavaScriptView Raw
1var anObject = require('../internals/an-object');
2var getIteratorMethod = require('../internals/get-iterator-method');
3
4module.exports = function (it) {
5 var iteratorMethod = getIteratorMethod(it);
6 if (typeof iteratorMethod != 'function') {
7 throw TypeError(String(it) + ' is not iterable');
8 } return anObject(iteratorMethod.call(it));
9};