{"name":"es-get-iterator","version":"1.0.2","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.2","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.17.0-next.1","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":"6d087cbd9ae21fc4a9ba2833cb9a3831460a5e5d","_id":"es-get-iterator@1.0.2","_nodeVersion":"13.3.0","_npmVersion":"6.13.1","dist":{"integrity":"sha512-ZHb4fuNK3HKHEOvDGyHPKf5cSWh/OvAMskeM/+21NMnTuvqFvz8uHatolu+7Kf6b6oK9C+3Uo1T37pSGPWv0MA==","shasum":"bc99065aa8c98ce52bc86ab282dedbba4120e0b3","tarball":"http://registry-npm.ywwl.com/es-get-iterator/download/es-get-iterator-1.0.2.tgz","fileCount":19,"unpackedSize":23233,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd9/CdCRA9TVsSAnZWagAAElgQAJNJrb1z8ShAOtmNMIFB\nZhJM705zioF9fef+Yu0PzVQUjA49d6LCicOi9b+cN1oEOeW3+FUju+YXyd35\nsuGfqZkd6HayXuiz4dupxmTVPjAYjzPuln1G+6zDFzHyJuvvOug4GT5Ppf5S\nkFdFTQzb67uaibwddPUlh08ZTmwET7K+1sKnxOEcJiSBICQlJY46RIO16xSt\nC0uHwH/EyPPjSJiHpxfEUy+wIEEaF1V9iGGL+R6T7o2Lj8mIfjtPabWIRrcE\nvpaEAyLWEzwPptW2huHRM9GQjI1hLGAEx542GtAbgBkmvGcUPQc+a5Xdu+D9\nBvYHNNBTmZpfIXfbXfEmVJrErE9gDk8cAVFPXZgWfLN7DJKaHUWW5al1KtMQ\nbom4nnoIx5laOgAKCTLl7PabftjxVSfvL/sMJIkMoFflnYXRmB5Cki0PCARz\n9ogFLw/kmq0JLCONiU3vI3PTCusPSL0ABNNVv7kz7OKzdYgEBk5gT7p+Do9K\nfqhXB6W8CdX3Wgnbs/JXIpsXQNfmkKcMko6IjbR/z2/vBIfbHMsRM38uC1dH\njAkdfJuCkf08X9d09Vzcm5VxZ2qKVSjbaSWCnh0Pq8qmeabRFVIBfW6TC5n9\nzoTXYVd+2DNcoF2yiTjxjKxtycpyOSsxso1h5INK/1UGFmB2GDEQ42b6/yYm\nwHvZ\r\n=Wq5i\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBg2s5e99/+3u9FV7iRk2RvVfj2tpNFiBVa7wS769KQeAiB1OSrbhMyxPWn0inbTXYh5Q0xcOl6AsTfyxcrIuCn3DA=="}],"size":8566,"noattachment":false,"key":"/es-get-iterator/-/es-get-iterator-1.0.2.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.2_1576530076853_0.36654094578237295"},"_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":1576530076996,"_cnpm_publish_time":1576530076996,"dist-tags":{"latest":"1.1.3"}}