Sha256: 20f2cdb54bf9bd650c5cb3d973032309749dab0cebe5947aec650d702fd3dcec

Contents?: true

Size: 581 Bytes

Versions: 47

Compression:

Stored size: 581 Bytes

Contents

"use strict";

var isArguments    = require("es5-ext/function/is-arguments")
  , isString       = require("es5-ext/string/is-string")
  , ArrayIterator  = require("./array")
  , StringIterator = require("./string")
  , iterable       = require("./valid-iterable")
  , iteratorSymbol = require("es6-symbol").iterator;

module.exports = function (obj) {
	if (typeof iterable(obj)[iteratorSymbol] === "function") return obj[iteratorSymbol]();
	if (isArguments(obj)) return new ArrayIterator(obj);
	if (isString(obj)) return new StringIterator(obj);
	return new ArrayIterator(obj);
};

Version data entries

47 entries across 47 versions & 3 rubygems

Version Path
govuk_publishing_components-16.20.0 node_modules/es6-iterator/get.js
govuk_publishing_components-16.19.0 node_modules/es6-iterator/get.js
govuk_publishing_components-16.18.0 node_modules/es6-iterator/get.js
govuk_publishing_components-16.17.0 node_modules/es6-iterator/get.js
optimacms-0.4.3 spec/dummy/node_modules/es6-iterator/get.js
optimacms-0.4.2 spec/dummy/node_modules/es6-iterator/get.js
cortex-0.1.3 spec/dummy/node_modules/es6-iterator/get.js