{"_id":"utils-copy-error","_rev":"4086861","name":"utils-copy-error","description":"Copy an error object.","dist-tags":{"latest":"1.0.1"},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}],"time":{"modified":"2025-12-02T22:11:27.000Z","created":"2015-12-30T08:45:23.792Z","1.0.1":"2015-12-30T11:57:08.476Z","1.0.0":"2015-12-30T08:45:44.070Z","0.0.0":"2015-12-30T08:45:23.792Z"},"users":{},"author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"repository":{"type":"git","url":"git://github.com/kgryte/utils-copy-error.git"},"versions":{"1.0.1":{"name":"utils-copy-error","version":"1.0.1","description":"Copy an error object.","author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"scripts":{"test":"if [ \"${TRAVIS}\" ]; then npm run test-ci; else npm run test-local; fi","test-local":"tape \"./test/*.js\" | tap-spec","test-ci":"npm run test-local && xvfb-run npm run test-browsers","test-cov":"istanbul cover --dir ./reports/coverage --report lcov tape -- \"./test/*.js\"","test-browsers":"browserify ./test/*.js | testling | tap-spec","coverage":"istanbul cover --dir ./reports/codecov/coverage --report lcovonly tape -- \"./test/*.js\" && cat ./reports/codecov/coverage/lcov.info | codecov && rm -rf ./reports/codecov"},"main":"./lib","repository":{"type":"git","url":"git://github.com/kgryte/utils-copy-error.git"},"keywords":["utilities","utils","utility","util","copy","clone","cp","object","obj","error","err","uri","urierror","syntax","syntaxerror","reference","referenceerror","type","typeerror","eval","evalerror","range","rangeerror"],"bugs":{"url":"https://github.com/kgryte/utils-copy-error/issues"},"dependencies":{"object-keys":"^1.0.9","utils-copy":"^1.1.0"},"devDependencies":{"browserify":"12.x.x","codecov.io":"^0.1.5","detect-class-support":"^1.0.0","istanbul":"^0.4.1","jshint":"2.x.x","jshint-stylish":"2.x.x","tap-spec":"4.x.x","tape":"4.x.x","testling":"1.x.x"},"testling":{"files":["test/*.js"],"browsers":["iexplore/6.0..latest","firefox/3.0..latest","firefox/nightly","chrome/4.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"license":"MIT","gitHead":"5e2f5e3bbbe2e296ef759ef4c8f64d575ab4f356","homepage":"https://github.com/kgryte/utils-copy-error#readme","_id":"utils-copy-error@1.0.1","_shasum":"791de393c0f09890afd59f3cbea635f079a94fa5","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"dist":{"shasum":"791de393c0f09890afd59f3cbea635f079a94fa5","size":3649,"noattachment":false,"key":"/utils-copy-error/-/utils-copy-error-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/utils-copy-error/download/utils-copy-error-1.0.1.tgz"},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}],"directories":{},"publish_time":1451476628476,"_hasShrinkwrap":false,"_cnpm_publish_time":1451476628476,"_cnpmcore_publish_time":"2021-12-17T00:23:44.941Z"},"1.0.0":{"name":"utils-copy-error","version":"1.0.0","description":"Copy an error object.","author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"scripts":{"test":"if [ \"${TRAVIS}\" ]; then npm run test-ci; else npm run test-local; fi","test-local":"tape \"./test/*.js\" | tap-spec","test-ci":"npm run test-local && xvfb-run npm run test-browsers","test-cov":"istanbul cover --dir ./reports/coverage --report lcov tape -- \"./test/*.js\"","test-browsers":"browserify ./test/*.js | testling | tap-spec","coverage":"istanbul cover --dir ./reports/codecov/coverage --report lcovonly tape -- \"./test/*.js\" && cat ./reports/codecov/coverage/lcov.info | codecov && rm -rf ./reports/codecov"},"main":"./lib","repository":{"type":"git","url":"git://github.com/kgryte/utils-copy-error.git"},"keywords":["utilities","utils","utility","util","copy","clone","cp","object","obj","error","err","uri","urierror","syntax","syntaxerror","reference","referenceerror","type","typeerror","eval","evalerror","range","rangeerror"],"bugs":{"url":"https://github.com/kgryte/utils-copy-error/issues"},"dependencies":{"object-keys":"^1.0.9","utils-copy":"^1.0.0"},"devDependencies":{"browserify":"12.x.x","codecov.io":"^0.1.5","detect-class-support":"^1.0.0","istanbul":"^0.4.1","jshint":"2.x.x","jshint-stylish":"2.x.x","tap-spec":"4.x.x","tape":"4.x.x","testling":"1.x.x"},"testling":{"files":["test/*.js"],"browsers":["iexplore/6.0..latest","firefox/3.0..latest","firefox/nightly","chrome/4.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"license":"MIT","gitHead":"2ad1793f63c2c4d90275abaa20c6c30f90aad7c5","homepage":"https://github.com/kgryte/utils-copy-error#readme","_id":"utils-copy-error@1.0.0","_shasum":"222cb84481929c3adbc7e25c7dce1d43d2221ab6","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"dist":{"shasum":"222cb84481929c3adbc7e25c7dce1d43d2221ab6","size":3646,"noattachment":false,"key":"/utils-copy-error/-/utils-copy-error-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/utils-copy-error/download/utils-copy-error-1.0.0.tgz"},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}],"directories":{},"publish_time":1451465144070,"_hasShrinkwrap":false,"_cnpm_publish_time":1451465144070,"_cnpmcore_publish_time":"2021-12-17T00:23:45.148Z"},"0.0.0":{"name":"utils-copy-error","version":"0.0.0","description":"Copy an error object.","author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"scripts":{"test":"if [ \"${TRAVIS}\" ]; then npm run test-ci; else npm run test-local; fi","test-local":"tape \"./test/*.js\" | tap-spec","test-ci":"npm run test-local && xvfb-run npm run test-browsers","test-cov":"istanbul cover --dir ./reports/coverage --report lcov tape -- \"./test/*.js\"","test-browsers":"browserify ./test/*.js | testling | tap-spec","coverage":"istanbul cover --dir ./reports/codecov/coverage --report lcovonly tape -- \"./test/*.js\" && cat ./reports/codecov/coverage/lcov.info | codecov && rm -rf ./reports/codecov"},"main":"./lib","repository":{"type":"git","url":"git://github.com/kgryte/utils-copy-error.git"},"keywords":["utilities","utils","utility","util","copy","clone","cp","object","obj","error","err","uri","urierror","syntax","syntaxerror","reference","referenceerror","type","typeerror","eval","evalerror","range","rangeerror"],"bugs":{"url":"https://github.com/kgryte/utils-copy-error/issues"},"dependencies":{"object-keys":"^1.0.9","utils-copy":"^1.0.0"},"devDependencies":{"browserify":"12.x.x","codecov.io":"^0.1.5","detect-class-support":"^1.0.0","istanbul":"^0.4.1","jshint":"2.x.x","jshint-stylish":"2.x.x","tap-spec":"4.x.x","tape":"4.x.x","testling":"1.x.x"},"testling":{"files":["test/*.js"],"browsers":["iexplore/6.0..latest","firefox/3.0..latest","firefox/nightly","chrome/4.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"license":"MIT","gitHead":"5beedbc71ca43c13b2c21327b67dee23a0e505e8","homepage":"https://github.com/kgryte/utils-copy-error#readme","_id":"utils-copy-error@0.0.0","_shasum":"763f14d8487774954925b60ac47ad4e0740d544d","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"dist":{"shasum":"763f14d8487774954925b60ac47ad4e0740d544d","size":3647,"noattachment":false,"key":"/utils-copy-error/-/utils-copy-error-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/utils-copy-error/download/utils-copy-error-0.0.0.tgz"},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}],"directories":{},"publish_time":1451465123792,"_hasShrinkwrap":false,"_cnpm_publish_time":1451465123792,"_cnpmcore_publish_time":"2021-12-17T00:23:45.373Z"}},"readme":"Copy Error\n===\n[![NPM version][npm-image]][npm-url] [![Build Status][build-image]][build-url] [![Coverage Status][coverage-image]][coverage-url] [![Dependencies][dependencies-image]][dependencies-url]\n\n> Copy an [`error`][js-error] object.\n\n\n## Installation\n\n``` bash\n$ npm install utils-copy-error\n```\n\n\n## Usage\n\n``` javascript\nvar copy = require( 'utils-copy-error' );\n```\n\n#### copy( error )\n\nCopy an [`error`][js-error] object.\n\n``` javascript\nvar err1 = new TypeError( 'beep' );\n\nvar err2 = copy( err1 );\n// returns <TypeError>\n```\n\n\n## Notes\n\n*\tSupported built-in `error` types:\n\t-\t[`Error`][js-error]\n\t- \t[`URIError`][js-uri-error]\n\t-\t[`ReferenceError`][js-reference-error]\n\t-\t[`SyntaxError`][js-syntax-error]\n\t-\t[`RangeError`][js-range-error]\n\t-\t[`EvalError`][js-eval-error]\n\t-\t[`TypeError`][js-type-error]\n\t-\t[`System Error`][node-system-error] (Node.js)\n\n*\tThe `function` also supports custom [`error`][js-error] types which are [`Error`][js-error] instances (e.g., ES2015 subclasses).\n*\tThe `function` [deep copies][utils-copy] over all `enumerable` properties, including property descriptors. \n\n\n## Examples\n\n``` javascript\nvar copy = require( 'utils-copy-error' );\n\nvar err1;\nvar err2;\n\nerr1 = new Error( 'beep' );\nerr2 = copy( err1 );\n\nconsole.log( err1 === err2 );\n// returns false\n\nconsole.log( err1.message === err2.message );\n// returns true\n\nerr1 = new TypeError( 'bad type' );\nerr2 = copy (err1 );\n\nconsole.log( err1 === err2 );\n// returns false\n\nconsole.log( err1.stack === err2.stack );\n// returns true\n\nerr1 = new RangeError( 'invalid value' );\nerr2 = copy( err1 );\n\nconsole.log( err1 === err2 );\n// returns false\n\nconsole.log( err1.name === err2.name );\n// returns true\n```\n\nTo run the example code from the top-level application directory,\n\n``` bash\n$ node ./examples/index.js\n```\n\n\n---\n## Tests\n\n### Unit\n\nThis repository uses [tape][tape] for unit tests. To run the tests, execute the following command in the top-level application directory:\n\n``` bash\n$ make test\n```\n\nAll new feature development should have corresponding unit tests to validate correct functionality.\n\n\n### Test Coverage\n\nThis repository uses [Istanbul][istanbul] as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:\n\n``` bash\n$ make test-cov\n```\n\nIstanbul creates a `./reports/coverage` directory. To access an HTML version of the report,\n\n``` bash\n$ make view-cov\n```\n\n\n### Browser Support\n\nThis repository uses [Testling][testling] for browser testing. To run the tests in a (headless) local web browser, execute the following command in the top-level application directory:\n\n``` bash\n$ make test-browsers\n```\n\nTo view the tests in a local web browser,\n\n``` bash\n$ make view-browser-tests\n```\n\n<!-- [![browser support][browsers-image]][browsers-url] -->\n\n\n---\n## License\n\n[MIT license](http://opensource.org/licenses/MIT). \n\n\n## Copyright\n\nCopyright &copy; 2015. Athan Reines.\n\n\n[npm-image]: http://img.shields.io/npm/v/utils-copy-error.svg\n[npm-url]: https://npmjs.org/package/utils-copy-error\n\n[build-image]: http://img.shields.io/travis/kgryte/utils-copy-error/master.svg\n[build-url]: https://travis-ci.org/kgryte/utils-copy-error\n\n[coverage-image]: https://img.shields.io/codecov/c/github/kgryte/utils-copy-error/master.svg\n[coverage-url]: https://codecov.io/github/kgryte/utils-copy-error?branch=master\n\n[dependencies-image]: http://img.shields.io/david/kgryte/utils-copy-error.svg\n[dependencies-url]: https://david-dm.org/kgryte/utils-copy-error\n\n[dev-dependencies-image]: http://img.shields.io/david/dev/kgryte/utils-copy-error.svg\n[dev-dependencies-url]: https://david-dm.org/dev/kgryte/utils-copy-error\n\n[github-issues-image]: http://img.shields.io/github/issues/kgryte/utils-copy-error.svg\n[github-issues-url]: https://github.com/kgryte/utils-copy-error/issues\n\n[browsers-image]: https://ci.testling.com/kgryte/utils-copy-error.png\n[browsers-url]: https://ci.testling.com/kgryte/utils-copy-error\n\n[tape]: https://github.com/substack/tape\n[istanbul]: https://github.com/gotwarlost/istanbul\n[testling]: https://ci.testling.com\n\n[js-error]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error\n[js-type-error]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError\n[js-syntax-error]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError\n[js-range-error]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError\n[js-reference-error]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError\n[js-uri-error]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError\n[js-eval-error]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError\n[node-system-error]: https://nodejs.org/api/errors.html#errors_class_system_error\n\n[utils-copy]: https://github.com/kgryte/utils-copy\n","_attachments":{},"homepage":"https://github.com/kgryte/utils-copy-error#readme","bugs":{"url":"https://github.com/kgryte/utils-copy-error/issues"},"license":"MIT"}