get-iterator-flattenable.js 496 B

1234567891011
  1. 'use strict';
  2. var call = require('../internals/function-call');
  3. var anObject = require('../internals/an-object');
  4. var getIteratorDirect = require('../internals/get-iterator-direct');
  5. var getIteratorMethod = require('../internals/get-iterator-method');
  6. module.exports = function (obj, stringHandling) {
  7. if (!stringHandling || typeof obj !== 'string') anObject(obj);
  8. var method = getIteratorMethod(obj);
  9. return getIteratorDirect(anObject(method !== undefined ? call(method, obj) : obj));
  10. };