"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/es5-ext/node_modules/es6-iterator/get.js" (7 Feb 2017, 581 Bytes) of archive /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 'use strict';
    2 
    3 var isArguments    = require('es5-ext/function/is-arguments')
    4   , isString       = require('es5-ext/string/is-string')
    5   , ArrayIterator  = require('./array')
    6   , StringIterator = require('./string')
    7   , iterable       = require('./valid-iterable')
    8   , iteratorSymbol = require('es6-symbol').iterator;
    9 
   10 module.exports = function (obj) {
   11     if (typeof iterable(obj)[iteratorSymbol] === 'function') return obj[iteratorSymbol]();
   12     if (isArguments(obj)) return new ArrayIterator(obj);
   13     if (isString(obj)) return new StringIterator(obj);
   14     return new ArrayIterator(obj);
   15 };