{"name":"es-get-iterator","version":"1.0.0","description":"Get an iterator for any JS language value. Works robustly across all environments, all versions.","main":"index","exports":{".":[{"browser":"./index.js","default":"./node.js"},"./node.js"],"./package":"./package.json","./package.json":"./package.json"},"type":"commonjs","scripts":{"prepublish":"safe-publish-latest","lint":"eslint .","pretest":"npm run lint","tests-only":"nyc node test/${TEST_VARIANT-}","test":"npm run tests-only","posttest":"npx aud --production","version":"auto-changelog && git add CHANGELOG.md","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""},"repository":{"type":"git","url":"git+https://github.com/ljharb/es-get-iterator.git"},"keywords":["iterator","Symbol.iterator","iterable","collection","next","iteration"],"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"funding":{"url":"https://github.com/sponsors/ljharb"},"license":"MIT","bugs":{"url":"https://github.com/ljharb/es-get-iterator/issues"},"homepage":"https://github.com/ljharb/es-get-iterator#readme","devDependencies":{"@ljharb/eslint-config":"^15.0.2","auto-changelog":"^1.16.2","core-js":"^2.6.10 || ^3.4.2","es5-shim":"^4.5.13","es6-shim":"^0.35.5","eslint":"^6.7.1","for-each":"^0.3.3","has-bigints":"^1.0.0","nyc":"^10.3.2","object-inspect":"^1.7.0","safe-publish-latest":"^1.1.4","tape":"^4.11.0"},"testling":{"files":"./test/browser.js"},"greenkeeper":{"ignore":["nyc"]},"dependencies":{"es-abstract":"^1.16.2","has-symbols":"^1.0.1","is-arguments":"^1.0.4","is-map":"^2.0.0","is-set":"^2.0.0","is-string":"^1.0.4","isarray":"^2.0.5"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false},"gitHead":"e77c9850213b5f40e6d34a81a7b589c695e04141","_id":"es-get-iterator@1.0.0","_nodeVersion":"13.2.0","_npmVersion":"6.13.1","dist":{"integrity":"sha512-IhfNVZEhHFZ6NOy5/SDCNvHpbGHePOl4vpYB4sebNrMOZfizdpLtiYAN9Yc1wBlgyG5Z22fLVtxmmnko45YSmQ==","shasum":"2af15002c9ae52d5954b7e065ca5b85b9d638d66","tarball":"http://registry-npm.ywwl.com/es-get-iterator/download/es-get-iterator-1.0.0.tgz","fileCount":18,"unpackedSize":21814,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd3K/vCRA9TVsSAnZWagAAseIQAKN5r6hR+UNzqTORckl5\nmY8hiKu0RtgdJyg43+s6juO0pJJejtNgpXtAAjfuNwQzytNpGjVYpxOaZrJw\nb/4J3VpZGGEqkTvW+8Grw8TKDAww6QS3hp8ur2+3WcCX6n9UMgXYkWGQru1r\naYiMt9sRPYP7hb2oQk475EfURjemNICRYt2ExhKDraH0JwssshWIAa1u9efp\nuZQZJOLlqUJIvP0Futrgbt2LWptp2O9rof0Gat0OcvzCPoI9N5v+iJteMY6T\nyKzI8XKlmOog5yhoEhbypjsc1Vm/1a7TOlAke8Mc5Ojk31mmfFYXECSUJ8up\nPSo65im0Ap5fg59GXPM4ULOgUHbXI1xPpOAuFTWZtDPFZSb+49vfMgn5EFJH\nrLJ1QQs8i73BvcRycmq4+1unTFdNS91mja4UsoE8yqnzuiAq5VTZ0BUZWjTc\nicPEOChHlrMOt0ytLnR2W+/gUcrJHIkwTFzWhgDV6g04t7vs5PLX6sof+COV\nUoLL5iAt1QJP75e0911sSpQbbFtMPWhMe8hIUxfKC5nMW7Gyvbj8u0a+bF33\n1UbmHXUfkcv9JqW7saW1AfPmMtiK9nCRGCmuq76QtvVvFwAjt+i7n4ZMgKNs\nsXOAHsEhKtBIm+sZEDyRWOKHuRd6Tt4zCfRrTKv+AgHDKhqR9EKgtVGKmY0x\nhANp\r\n=AJpP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEHbEwMsMWHLNHfkU7Sz0OrZozec05lhATuhEJQZgRfrAiAAgYAkR5olB/hF342pERLPJ9xAU6JkgK3872GBLR3k7A=="}],"size":8174,"noattachment":false,"key":"/es-get-iterator/-/es-get-iterator-1.0.0.tgz"},"maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"}],"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/es-get-iterator_1.0.0_1574744046817_0.1538596718625953"},"_hasShrinkwrap":false,"readme":"# es-get-iterator <sup>[![Version Badge][npm-version-svg]][package-url]</sup>\n\n[![dependency status][deps-svg]][deps-url]\n[![dev dependency status][dev-deps-svg]][dev-deps-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][npm-badge-png]][package-url]\n\nGet an iterator for any JS language value. Works robustly across all environments, all versions.\n\nIn modern engines, `value[Symbol.iterator]()` is sufficient to produce an iterator (an object with a `.next` method) for that object. However, older engines:\n - may lack `Symbol` support altogether\n - may have `Symbol.iterator` but not implement it on everything it should, like arguments objects\n - may have `Map` and `Set`, but a non-standard name for the iterator-producing method (`.iterator` or `['@@iterator']`, eg)\n - may be old versions of Firefox that produce values until they throw a StopIteration exception, rather than having iteration result objects\n - may be polyfilled/shimmed/shammed, with `es6-shim` or `core-js` or similar\n\nThis library attempts to provide an abstraction over all that complexity!\n\nIn node v13+, `exports` is used to provide a lean implementation that lacks all the complexity described above, in combination with the `browser` field so that bundlers will pick up the proper implementation.\n\n## Targeting browsers with Symbol support\n\nIf you are targeting browsers that definitely all have Symbol support, then you can configure your bundler to replace `require('has-symbols')()` with a literal `true`, which should allow dead code elimination to reduce the size of the bundled code.\n\n### With `@rollup/plugin-replace`\n\n```js\n// rollup.config.js\n\nimport replace from '@rollup/plugin-replace';\n\nexport default {\n\t...\n\tplugins: [\n\t\treplace({\n\t\t\t\"require('has-symbols')()\": 'true',\n\t\t\tdelimiters: ['', '']\n\t\t})\n\t]\n};\n```\n\n## Example\n\n```js\nvar getIterator = require('es-get-iterator');\nvar assert = require('assert');\n\nvar iterator = getIterator('a 💩');\nassert.deepEqual(\n\t[iterator.next(), iterator.next(), iterator.next(), iterator.next()],\n\t[{ done: false, value: 'a' }, { done: false, value: ' ' }, { done: false, value: '💩' }, { done: true, value: undefined }]\n);\n\nvar iterator = getIterator([1, 2]);\nassert.deepEqual(\n\t[iterator.next(), iterator.next(), iterator.next()],\n\t[{ done: false, value: 1 }, { done: false, value: 2 }, { done: true, value: undefined }]\n);\n\nvar iterator = getIterator(new Set([1, 2]));\nassert.deepEqual(\n\t[iterator.next(), iterator.next(), iterator.next()],\n\t[{ done: false, value: 1 }, { done: false, value: 2 }, { done: true, value: undefined }]\n);\n\nvar iterator = getIterator(new Map([[1, 2], [3, 4]]));\nassert.deepEqual(\n\t[iterator.next(), iterator.next(), iterator.next()],\n\t[{ done: false, value: [1, 2] }, { done: false, value: [3, 4] }, { done: true, value: undefined }]\n);\n```\n\n## Tests\nSimply clone the repo, `npm install`, and run `npm test`\n\n[package-url]: https://npmjs.org/package/es-get-iterator\n[npm-version-svg]: https://versionbadg.es/ljharb/es-get-iterator.svg\n[deps-svg]: https://david-dm.org/ljharb/es-get-iterator.svg\n[deps-url]: https://david-dm.org/ljharb/es-get-iterator\n[dev-deps-svg]: https://david-dm.org/ljharb/es-get-iterator/dev-status.svg\n[dev-deps-url]: https://david-dm.org/ljharb/es-get-iterator#info=devDependencies\n[npm-badge-png]: https://nodei.co/npm/es-get-iterator.png?downloads=true&stars=true\n[license-image]: https://img.shields.io/npm/l/es-get-iterator.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/es-get-iterator.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=es-get-iterator\n","publish_time":1574744046917,"_cnpm_publish_time":1574744046917,"dist-tags":{"latest":"1.1.3"}}