{"name":"aggregate-error-ponyfill","version":"1.0.0","description":"AggregateError ponyfill.","license":"MIT","author":{"name":"Ivan Nikolić","email":"niksy5@gmail.com","url":"http://ivannikolic.com"},"sideEffects":false,"exports":{".":{"import":"./esm/index.js","require":"./cjs/index.js"},"./package.json":"./package.json"},"main":"cjs/index.js","module":"esm/index.js","directories":{"test":"test"},"scripts":{"build":"rollup --config rollup.config.js","lint":"eslint '{index,lib/**/*,test/**/*}.js'","module-check":"node -e 'require(\"aggregate-error-ponyfill\");' && node --input-type=module -e 'import \"aggregate-error-ponyfill\";'","prepublishOnly":"npm run build && npm run module-check","postpublish":"GITHUB_TOKEN=$GITHUB_RELEASE_TOKEN github-release-from-changelog","release":"np --no-release-draft","test":"npm run lint && npm run test:automated","test:automated":"BABEL_ENV=test karma start","test:automated:watch":"npm run test:automated -- --auto-watch --no-single-run","version":"version-changelog CHANGELOG.md && changelog-verify CHANGELOG.md && git add CHANGELOG.md"},"dependencies":{"is-iterable":"^1.1.1"},"devDependencies":{"@babel/cli":"^7.2.3","@babel/core":"^7.2.2","@babel/plugin-transform-member-expression-literals":"^7.12.1","@babel/plugin-transform-object-assign":"^7.2.0","@babel/plugin-transform-property-literals":"^7.12.1","@babel/plugin-transform-runtime":"^7.2.0","@babel/preset-env":"^7.12.1","@babel/runtime":"^7.2.0","@rollup/plugin-babel":"^5.2.1","@rollup/plugin-commonjs":"^15.1.0","@rollup/plugin-node-resolve":"^9.0.0","babel-plugin-native-error-extend":"^2.0.2","babel-plugin-transform-replace-expressions":"^0.2.0","changelog-verify":"^1.1.2","core-js":"^2.6.5","eslint":"^7.11.0","eslint-config-niksy":"^9.0.0","eslint-config-prettier":"^6.14.0","eslint-plugin-extend":"^0.1.1","eslint-plugin-import":"^2.22.1","eslint-plugin-jsdoc":"^30.7.3","eslint-plugin-mocha":"^8.0.0","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-promise":"^4.1.1","eslint-plugin-unicorn":"^23.0.0","esm":"^3.0.51","github-release-from-changelog":"^2.1.1","husky":"^4.3.0","karma":"^5.2.3","karma-browserstack-launcher":"^1.6.0","karma-chrome-launcher":"^3.1.0","karma-coverage-istanbul-reporter":"^3.0.3","karma-fixture":"^0.2.6","karma-html2js-preprocessor":"^1.1.0","karma-mocha":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-rollup-preprocessor":"^7.0.0","karma-sourcemap-loader":"^0.3.7","lint-staged":"^10.4.2","mocha":"^4.1.0","np":"^6.5.0","prettier":"^2.1.2","rollup":"^2.32.1","rollup-plugin-istanbul":"^2.0.1","rollup-plugin-node-builtins":"^2.1.2","rollup-plugin-node-globals":"^1.4.0","version-changelog":"^3.1.1"},"engines":{"node":">=10"},"keywords":["aggregateerror","promise","any","ponyfill","promise.any","error"],"repository":{"type":"git","url":"git+https://github.com/niksy/aggregate-error-ponyfill.git"},"bugs":{"url":"https://github.com/niksy/aggregate-error-ponyfill/issues"},"homepage":"https://github.com/niksy/aggregate-error-ponyfill#readme","gitHead":"9dd73593b7835a3a4f1b78abd02a21c0f212deba","_id":"aggregate-error-ponyfill@1.0.0","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-XjuMBhRa5wdFDvjqxZ6921VsdaBTCmzk3X1r3tLlrhcyqoGvxy5Xmq5W0PuK73opmAEGHRAfpuBqgf8eEJ1/aQ==","shasum":"38d96eaf1c20680cfacc0eefced29126d893c698","tarball":"http://registry-npm.ywwl.com/aggregate-error-ponyfill/download/aggregate-error-ponyfill-1.0.0.tgz","fileCount":10,"unpackedSize":19416,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0UfoCRA9TVsSAnZWagAACAQP/jTRKU2wzyUQDG0kIbSN\nC44eGRkqa2ke7JHN08PR0MbwKzF77eTK0S4WpH4Qtx3PPOoAfR+fzYCQ/6LE\n2QvzJ8suagzY0XV4/MKCF2rxxAHiK5NDSv6LK08NShm+NQSjbTZB/P0JhIDf\n7Q1cEJUYhd5zRVo/jSiuCVlLj4CXamwioVth1XS5FRh7K4McHBSLiTg2jHRj\nAq1zGzy5Gn7DkJ0gmSRYvtI5+Vx8rpuKpIbUbeeT9R9SInZToIi1nvKcEpqG\nBO651+jpIhlpdQabsVbEuxYvyB6tu0L8awtpf5Bz0bSY9x0TVzQRLPI3bJhz\npv8OI8tJ51fRNKSH6Rc8bmtkFKNKU1UZZFwZy3LL3DXBSojMjTk++C+Z5o5g\nJebk5ZQPJRQSAnaxLzwoScTOeoyDcb17CXmdFxgS6+tNc/aFz/3ZdnmJOlyA\njD0fFLS2lHqaBz/kFyEiaA9iiTwbDiTmrD1NlvoT1MdvDe13zAQbA2Bkh3Sj\ntvQ4h41Ru2AF1UGGsbtA/29vDahW6/dclnA0lSYiiHezAMM4wn5U/iOHIIb0\niNXwAzkmwrkpVOgF1Wx376mlsNwvj2zl7a/0TDzmwDwF+M8R53kSQi5X9+72\nTzbWTCHD9RT18Rx79GzZdDC4ZGnBnl3XTpg0AKp9n8+VDxMcrPBjWCIFjPKd\ncM4S\r\n=0KlC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGkTeRPgqWQtAtjmKJYM4j5va9mUTUyvk/WtjWDJCM/AIgScW5fcbl3DnTb3lAFGIeRAzUvqYeq1E4PGUF8cXvFf4="}],"size":5417,"noattachment":false,"key":"/aggregate-error-ponyfill/-/aggregate-error-ponyfill-1.0.0.tgz"},"_npmUser":{"name":"niksy","email":"niksy5@gmail.com"},"maintainers":[{"name":"niksy","email":"niksy5@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aggregate-error-ponyfill_1.0.0_1607550951619_0.40031033729760934"},"_hasShrinkwrap":false,"readme":"# aggregate-error-ponyfill\n\n[![Build Status][ci-img]][ci]\n[![BrowserStack Status][browserstack-img]][browserstack]\n\n[`AggregateError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError)\n[ponyfill](https://ponyfill.com).\n\n> The `AggregateError` object represents an error when several errors need to be\n> wrapped in a single error. It is thrown when multiple errors need to be\n> reported by an operation, for example by `Promise.any()`, when all promises\n> passed to it reject.\n\n## Install\n\n```sh\nnpm install aggregate-error-ponyfill --save\n```\n\n## Usage\n\n```js\nimport AggregateError from 'aggregate-error-ponyfill';\n\n(async () => {\n\ttry {\n\t\tawait Promise.any([Promise.reject(new Error('some error'))]);\n\t} catch (e) {\n\t\tconsole.log(e instanceof AggregateError); // true\n\t\tconsole.log(e.message); // \"All Promises rejected\"\n\t\tconsole.log(e.name); // \"AggregateError\"\n\t\tconsole.log(e.errors); // [ Error: \"some error\" ]\n\t}\n})();\n\ntry {\n\tthrow new AggregateError([new Error('some error')], 'Hello');\n} catch (e) {\n\tconsole.log(e instanceof AggregateError); // true\n\tconsole.log(e.message); // \"Hello\"\n\tconsole.log(e.name); // \"AggregateError\"\n\tconsole.log(e.errors); // [ Error: \"some error\" ]\n}\n```\n\nYou can **use named export `preferNative` if you wish to use native\nimplementation if it’s available**. In all other cases, ponyfill will be used.\nBeware of\n[caveats](https://github.com/sindresorhus/ponyfill#user-content-ponyfill:~:text=Ponyfills%20should%20never%20use%20the%20native,between%20environments%2C%20which%20can%20cause%20bugs.)!\n\n## API\n\n### AggregateError(errors[, message])\n\nReturns: `AggregateError`\n\nMethod description.\n\n#### errors\n\nType: `Iterable`\n\nAn iterable of errors, may not actually be `Error` instances.\n\n#### message\n\nType: `string`\n\nAn optional human-readable description of the aggregate error.\n\n## Browser support\n\nTested in IE11+ and all modern browsers.\n\nIt works in older IE versions such as IE9, but you can’t test for\n`instanceof AggregateError` due to\n[proper subclassing of native classes](https://babeljs.io/docs/en/caveats/#classes).\n\n## Test\n\nTest suite is taken and modified from\n[`es-shims/AggregateError`](https://github.com/es-shims/AggregateError/blob/main/test/tests.js)\npolyfill.\n\nFor automated tests, run `npm run test:automated` (append `:watch` for watcher\nsupport).\n\n## License\n\nMIT © [Ivan Nikolić](http://ivannikolic.com)\n\n<!-- prettier-ignore-start -->\n\n[ci]: https://travis-ci.com/niksy/aggregate-error-ponyfill\n[ci-img]: https://travis-ci.com/niksy/aggregate-error-ponyfill.svg?branch=master\n[browserstack]: https://www.browserstack.com/\n[browserstack-img]: https://www.browserstack.com/automate/badge.svg?badge_key=MnlLM05YZTZTOWlVcHNiUjh0WCtnN1RraklaQ3ZkN0VsVStOSisza3ZwYz0tLXFyT0RBTklSaklVZlI3WHJNc3VWQlE9PQ==--f14238d77ebc29dc4dea435f3e3ab0ce47bb40c2\n\n<!-- prettier-ignore-end -->\n","publish_time":1607550951727,"_cnpm_publish_time":1607550951727,"dist-tags":{"latest":"1.1.0"}}