{"_id":"aggregate-error-ponyfill","_rev":"3549219","name":"aggregate-error-ponyfill","description":"AggregateError ponyfill.","dist-tags":{"latest":"1.1.0"},"maintainers":[{"name":"niksy","email":"niksy5@gmail.com"}],"time":{"modified":"2024-09-19T02:39:08.000Z","created":"2020-12-09T21:55:51.727Z","1.1.0":"2020-12-17T11:39:09.990Z","1.0.1":"2020-12-15T16:14:56.931Z","1.0.0":"2020-12-09T21:55:51.727Z"},"users":{},"author":{"name":"Ivan Nikolić","email":"niksy5@gmail.com","url":"http://ivannikolic.com"},"repository":{"type":"git","url":"git+https://github.com/niksy/aggregate-error-ponyfill.git"},"versions":{"1.1.0":{"name":"aggregate-error-ponyfill","version":"1.1.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-globalthis":"^1.0.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":"git+https://github.com/billowz/rollup-plugin-istanbul.git#rc","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":"14bb7c9ee4c10c0a3a3a8086a656c8f71094c28e","_id":"aggregate-error-ponyfill@1.1.0","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"shasum":"744993b0f4006c05a32769adc6b7e441c754e886","size":5746,"noattachment":false,"key":"/aggregate-error-ponyfill/-/aggregate-error-ponyfill-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/aggregate-error-ponyfill/download/aggregate-error-ponyfill-1.1.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.1.0_1608205149865_0.7388177484222549"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-26T20:27:42.918Z","publish_time":1608205149990,"_cnpm_publish_time":1608205149990},"1.0.1":{"name":"aggregate-error-ponyfill","version":"1.0.1","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","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":"6d06f4b2cc9a6a8673b2bbb4bad02afe1acb23ef","_id":"aggregate-error-ponyfill@1.0.1","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"shasum":"876221d1dca8918245f60463401db04bec3682c7","size":5321,"noattachment":false,"key":"/aggregate-error-ponyfill/-/aggregate-error-ponyfill-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/aggregate-error-ponyfill/download/aggregate-error-ponyfill-1.0.1.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.1_1608048896811_0.1575285529544248"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-26T20:27:42.023Z","publish_time":1608048896931,"_cnpm_publish_time":1608048896931},"1.0.0":{"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":{"shasum":"38d96eaf1c20680cfacc0eefced29126d893c698","size":5417,"noattachment":false,"key":"/aggregate-error-ponyfill/-/aggregate-error-ponyfill-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/aggregate-error-ponyfill/download/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,"_cnpmcore_publish_time":"2021-12-26T20:27:41.115Z","publish_time":1607550951727,"_cnpm_publish_time":1607550951727}},"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","_attachments":{},"homepage":"https://github.com/niksy/aggregate-error-ponyfill#readme","bugs":{"url":"https://github.com/niksy/aggregate-error-ponyfill/issues"},"license":"MIT"}