get-iterator-flattenable.js 482 B

1234567891011
  1. var call = require('../internals/function-call');
  2. var isCallable = require('../internals/is-callable');
  3. var toObject = require('../internals/to-object');
  4. var getIteratorDirect = require('../internals/get-iterator-direct');
  5. var getIteratorMethod = require('../internals/get-iterator-method');
  6. module.exports = function (obj) {
  7. var object = toObject(obj);
  8. var method = getIteratorMethod(object);
  9. return getIteratorDirect(isCallable(method) ? call(method, object) : object);
  10. };