core.is-iterable.js 373 B

12345678910
  1. var classof = require('./_classof');
  2. var ITERATOR = require('./_wks')('iterator');
  3. var Iterators = require('./_iterators');
  4. module.exports = require('./_core').isIterable = function (it) {
  5. var O = Object(it);
  6. return O[ITERATOR] !== undefined
  7. || '@@iterator' in O
  8. // eslint-disable-next-line no-prototype-builtins
  9. || Iterators.hasOwnProperty(classof(O));
  10. };