{"_id":"incident","_rev":"36-751f821134fdea5a2d47538240b07956","name":"incident","description":"Errors with superpowers","dist-tags":{"latest":"3.2.1","next":"3.1.1-build.132"},"versions":{"1.0.1":{"name":"incident","version":"1.0.1","description":"Simple custom errors.","main":"build/node/node/main.js","repository":{"type":"git","url":"git://github.com/Demurgos/incident.git"},"scripts":{"test":"gulp test","postinstall":"gulp install.noNpm"},"keywords":["error"],"author":"","license":"MIT","devDependencies":{"chai":"^3.4.1","gulp":"^3.9.0","via-build-tools":"^0.3.0"},"jspm":{"configFile":"systemjs.config.js","dependencies":{"lodash":"npm:lodash@^4.0.0"},"devDependencies":{}},"dependencies":{"lodash":"^4.0.0"},"gitHead":"7a3d2d18d267b679133aa692958a60eedabe0bb6","bugs":{"url":"https://github.com/Demurgos/incident/issues"},"homepage":"https://github.com/Demurgos/incident#readme","_id":"incident@1.0.1","_shasum":"cf68337f1968a8993b00a75b6ff264be0e4a2178","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.1.0","_npmUser":{"name":"demurgos","email":"csamborski@hotmail.fr"},"dist":{"shasum":"cf68337f1968a8993b00a75b6ff264be0e4a2178","tarball":"https://registry.npmjs.org/incident/-/incident-1.0.1.tgz","integrity":"sha512-v44vNpA74/PQCvthP7kBu4PLEjGOtL49PsJMyc8JBPHAt5EkxLP2U9g+aMbANaYIbUfCBHeVjYK/5NGDg4vwwg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBfuVweuy1RXqHTunaVjvQz9oAhnsTrB3c57wksdiLdSAiBBIobPQONkRGeeGAgCvzweyPL/BMuQyCaRFZrTQzP3GQ=="}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"directories":{}},"1.0.2":{"name":"incident","version":"1.0.2","description":"Simple custom errors.","main":"dist/node/node/main.js","repository":{"type":"git","url":"git://github.com/Demurgos/incident.git"},"scripts":{"test":"gulp test","postinstall":"gulp install.noNpm"},"keywords":["error"],"author":"","license":"MIT","devDependencies":{"chai":"^3.4.1","gulp":"^3.9.0","via-build-tools":"^0.3.2"},"jspm":{"configFile":"systemjs.config.js","dependencies":{"lodash":"npm:lodash@^4.0.0"},"devDependencies":{}},"dependencies":{"lodash":"^4.0.0"},"gitHead":"1121de96fff2e501db96ef90dbb6df7e6de391ba","bugs":{"url":"https://github.com/Demurgos/incident/issues"},"homepage":"https://github.com/Demurgos/incident#readme","_id":"incident@1.0.2","_shasum":"46e76c7818d070341f258e835966d0b5e4489ff7","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.1.0","_npmUser":{"name":"demurgos","email":"csamborski@hotmail.fr"},"dist":{"shasum":"46e76c7818d070341f258e835966d0b5e4489ff7","tarball":"https://registry.npmjs.org/incident/-/incident-1.0.2.tgz","integrity":"sha512-q6Dy+vw2UV1KCO2gYoyEL5c93/XX9PUAvhdUm8lY/vVWBTzFauorhwtgRQZK3KEB5fXPhz1CtzlILrUdL3NWtA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFHlvCWq9YegUD1iCrSbhsuDdTfYHahGx7Z0J3NRpHMwAiBYERSFwQok2ol3WT+w+1UfTG+aVJADnByGwNwmDCdotA=="}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"directories":{}},"1.0.3":{"name":"incident","version":"1.0.3","description":"Simple custom errors.","main":"dist/node/node/main.js","repository":{"type":"git","url":"git://github.com/Demurgos/incident.git"},"scripts":{"test":"gulp test","postinstall":"gulp install.noNpm"},"keywords":["error"],"author":"","license":"MIT","devDependencies":{"chai":"^3.4.1","gulp":"^3.9.0","gulp-mocha":"^2.2.0","mocha":"^2.3.4","via-build-tools":"^0.7.7"},"jspm":{"configFile":"systemjs.config.js","dependencies":{"lodash":"npm:lodash@^4.0.0"},"devDependencies":{}},"dependencies":{"lodash":"^4.0.0"},"gitHead":"6bd7aca9b18aa898533c5e266c2c802fbc7ff607","bugs":{"url":"https://github.com/Demurgos/incident/issues"},"homepage":"https://github.com/Demurgos/incident#readme","_id":"incident@1.0.3","_shasum":"cc835a8c5f0618334e16e47278aa13c9efbc155e","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"demurgos","email":"csamborski@hotmail.fr"},"dist":{"shasum":"cc835a8c5f0618334e16e47278aa13c9efbc155e","tarball":"https://registry.npmjs.org/incident/-/incident-1.0.3.tgz","integrity":"sha512-ixU4s4T4hCGWwrwahHZO3FpEmFofI0cLLvJarX6fk6D06tRoaMzZHZpBF7RrRzEPBY6bfuRqbZHa3W4/lkKwBw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEs33qmvN99lssPsVsbZV+7dv6rFRnOuzkUfJuTjsn5fAiEArJy2CUUHoyxJ/hAri4KHivuDRrwZ5qlvtZLHTmbH738="}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/incident-1.0.3.tgz_1460675140206_0.28191329538822174"},"directories":{}},"1.0.4":{"name":"incident","version":"1.0.4","description":"Simple custom errors.","main":"dist/node/node/main.js","repository":{"type":"git","url":"git://github.com/Demurgos/incident.git"},"scripts":{"test":"gulp test","postinstall":"gulp install.noNpm"},"keywords":["error"],"author":"","license":"MIT","devDependencies":{"chai":"^3.4.1","gulp":"^3.9.0","gulp-mocha":"^2.2.0","mocha":"^2.3.4","via-build-tools":"^0.7.7"},"jspm":{"configFile":"systemjs.config.js","dependencies":{"lodash":"npm:lodash@^4.0.0"},"devDependencies":{}},"dependencies":{"lodash":"^4.0.0"},"gitHead":"f09b3ec90e545fdbf39e3ba009ac9c6674b538ae","bugs":{"url":"https://github.com/Demurgos/incident/issues"},"homepage":"https://github.com/Demurgos/incident#readme","_id":"incident@1.0.4","_shasum":"9225984378c3bf43a377dadbab9d36373389dd8c","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"demurgos","email":"csamborski@hotmail.fr"},"dist":{"shasum":"9225984378c3bf43a377dadbab9d36373389dd8c","tarball":"https://registry.npmjs.org/incident/-/incident-1.0.4.tgz","integrity":"sha512-EQA5+KElILvdye/3bYEqggByG9t6new5+D34cmXkrEx5vTfxkBh1lvBKw11gT/GI0lR9H0epSkWDYFT7DftL9A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD6SEOvlzEGySPIC3EdMYjGVb3e9Ol83/ZE/llT1Od6oQIgD3nfaLbwfSnjsc5SowVIqUZZxgARoB4BfFGKuC3puTI="}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/incident-1.0.4.tgz_1460924954320_0.7447153842076659"},"directories":{}},"1.0.5":{"name":"incident","version":"1.0.5","description":"Simple custom errors.","main":"dist/node/incident.js","repository":{"type":"git","url":"git://github.com/Demurgos/incident.git"},"scripts":{"test":"gulp test"},"keywords":["error"],"author":"","license":"MIT","devDependencies":{"chai":"^3.4.1","gulp":"^3.9.0","gulp-mocha":"^2.2.0","mocha":"^2.3.4","via-build-tools":"^0.8.2"},"jspm":{"configFile":"systemjs.config.js","dependencies":{"lodash":"npm:lodash@^4.0.0"},"devDependencies":{}},"dependencies":{"lodash":"^4.0.0"},"gitHead":"5159558fefa87e800c55dda1da6ad126b2b3ee24","bugs":{"url":"https://github.com/Demurgos/incident/issues"},"homepage":"https://github.com/Demurgos/incident#readme","_id":"incident@1.0.5","_shasum":"89084f4af18d9e1d51481860efc57dc0efb31480","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"demurgos","email":"csamborski@hotmail.fr"},"dist":{"shasum":"89084f4af18d9e1d51481860efc57dc0efb31480","tarball":"https://registry.npmjs.org/incident/-/incident-1.0.5.tgz","integrity":"sha512-PijuNhL+zAoRKFMdZP2AkCqD+P9pt9i+rVxe5DmN9JasaD81gpJCrUMo4ASQLQpJ/SUJ4Wp9Z4psGUGlRnT9bQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDyqovgoSW2MDc3FHiZoSvFDKhwo7SuBWV8kSvvkT8MawIhAI3xuT11VlTYksdsgX4rOq7m+P2X4EEtKYvbq+NzZAxb"}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/incident-1.0.5.tgz_1461272473543_0.8695883268956095"},"directories":{}},"1.0.6":{"name":"incident","version":"1.0.6","description":"Simple custom errors.","main":"dist/node/incident.js","repository":{"type":"git","url":"git://github.com/Demurgos/incident.git"},"scripts":{"test":"gulp test"},"keywords":["error"],"author":"","license":"MIT","dependencies":{"lodash":"^4.12.0"},"devDependencies":{"chai":"^3.4.1","gulp":"^3.9.0","gulp-mocha":"^2.2.0","mocha":"^2.3.4","via-build-tools":"^0.9.0"},"gitHead":"2066d3bcd0ef4baf062fed2df4e1ec038a47a4da","bugs":{"url":"https://github.com/Demurgos/incident/issues"},"homepage":"https://github.com/Demurgos/incident#readme","_id":"incident@1.0.6","_shasum":"a17221fa585f6f4ddfb499b2d9c5f0d93c828d3a","_from":".","_npmVersion":"3.8.6","_nodeVersion":"6.1.0","_npmUser":{"name":"demurgos","email":"csamborski@hotmail.fr"},"dist":{"shasum":"a17221fa585f6f4ddfb499b2d9c5f0d93c828d3a","tarball":"https://registry.npmjs.org/incident/-/incident-1.0.6.tgz","integrity":"sha512-5t+0KnPyMtqSlMExhfUzX9oBJeMAjpfMcnZmIhHP0momMjEs79lvW8uHi8awDGfIbuF5cEcescRB3iEXME/BdQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFmBoWUMe5sfvLzIkpQQhplEszZmkYrEdkTBTz3WpLFCAiAHqWvOGYyoye1cKqsa+5RnVmrJFsxNU+Pre6rdCh8w0A=="}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/incident-1.0.6.tgz_1463863959803_0.5574526323471218"},"directories":{}},"1.0.7":{"name":"incident","version":"1.0.7","description":"Simple custom errors.","main":"dist/node/incident.js","repository":{"type":"git","url":"git://github.com/Demurgos/incident.git"},"scripts":{"test":"gulp test"},"keywords":["error"],"author":"","license":"MIT","dependencies":{"lodash":"^4.12.0"},"devDependencies":{"chai":"^3.4.1","gulp":"^3.9.0","gulp-mocha":"^2.2.0","mocha":"^2.3.4","via-build-tools":"^0.9.1"},"gitHead":"ec9c59c1742d4fd7c4617a19d46236a92b070ed8","bugs":{"url":"https://github.com/Demurgos/incident/issues"},"homepage":"https://github.com/Demurgos/incident#readme","_id":"incident@1.0.7","_shasum":"d6a69324301117d64ff545740687e90cc1fb17eb","_from":".","_npmVersion":"3.8.6","_nodeVersion":"6.1.0","_npmUser":{"name":"demurgos","email":"csamborski@hotmail.fr"},"dist":{"shasum":"d6a69324301117d64ff545740687e90cc1fb17eb","tarball":"https://registry.npmjs.org/incident/-/incident-1.0.7.tgz","integrity":"sha512-Hc1DpCPkKDIUSZyxLudzXd4FrPfLxTZn8MMM0jOJo8YBCEAlpCzPhLw9P+EyVSKxYNqz+4d5iStL6Ld4orr3ZQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8FFuq1W5lkkPJU3rWo+c+owmwEidnDH0Z05XavDvmRgIgTnVZ+Xsf33wyEtWNuZzDoR8fu/xpZeM3St820hB1/Oc="}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/incident-1.0.7.tgz_1464001259016_0.24985171086154878"},"directories":{}},"1.1.0":{"name":"incident","version":"1.1.0","description":"Simple errors","main":"dist/lib/lib/incident.js","repository":{"type":"git","url":"git://github.com/demurgos/incident.git"},"scripts":{"test":"gulp :lint && gulp lib-test:clean && gulp lib-test","prepublishOnly":"npm test && gulp lib:dist"},"keywords":["error"],"author":"","license":"MIT","devDependencies":{"chai":"^3.5.0","demurgos-web-build-tools":"0.13.0-alpha.0","gulp":"github:gulpjs/gulp#4.0","typescript":"^2.1.4"},"gitHead":"65c92ce8c8e94147279c3a3547141effb16fe29a","bugs":{"url":"https://github.com/demurgos/incident/issues"},"homepage":"https://github.com/demurgos/incident#readme","_id":"incident@1.1.0","_shasum":"ac883ff5e6d30677ecbc52dfb348b2f615c42646","_from":".","_npmVersion":"4.0.3","_nodeVersion":"7.2.1","_npmUser":{"name":"demurgos","email":"csamborski@hotmail.fr"},"dist":{"shasum":"ac883ff5e6d30677ecbc52dfb348b2f615c42646","tarball":"https://registry.npmjs.org/incident/-/incident-1.1.0.tgz","integrity":"sha512-eV5EVx+fAdp64CyYgz8yR/KjSkf2el0TXgDlbG6zdH8Ak0rOkM5wSuQ2PiiO8fXEGE8fjm8eg2I3doo6jRPNvA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB0XUCpDzDw3aVGJx+i7KNHiWO3fPrdpotSkhtcpPceoAiBMORPQLqHtez55JGdYwJR7YplZtE/DyP6IooelN1Cg4Q=="}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/incident-1.1.0.tgz_1481820417364_0.7776193376630545"},"directories":{}},"1.1.1":{"name":"incident","version":"1.1.1","description":"Simple errors","main":"dist/lib/lib/incident.js","types":"dist/lib/lib/incident.d.ts","repository":{"type":"git","url":"git://github.com/demurgos/incident.git"},"scripts":{"prepare":"typings install","test":"gulp :lint && gulp lib-test:clean && gulp lib-test","prepublishOnly":"npm test && gulp lib:dist"},"keywords":["error"],"author":"","license":"MIT","devDependencies":{"chai":"^3.5.0","demurgos-web-build-tools":"0.13.0-alpha.0","gulp":"github:gulpjs/gulp#4.0","typescript":"^2.1.4"},"gitHead":"e2264ebdb6b57356638eb07c240fb0da70942c51","bugs":{"url":"https://github.com/demurgos/incident/issues"},"homepage":"https://github.com/demurgos/incident#readme","_id":"incident@1.1.1","_shasum":"7105d021bf5a764e4165cd91116e42b2e2c35b07","_from":".","_npmVersion":"4.0.3","_nodeVersion":"7.2.1","_npmUser":{"name":"demurgos","email":"demurgos@demurgos.net"},"dist":{"shasum":"7105d021bf5a764e4165cd91116e42b2e2c35b07","tarball":"https://registry.npmjs.org/incident/-/incident-1.1.1.tgz","integrity":"sha512-d9OLfn+RN0oRdPlBLiFQ0RCU4L042hLS64J+iCSHxWG+/S2mFPWRDjDTuWscD7Q34BcjnuRYsWu48hQA3u9R3g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlRfByjNV45D2YFhC/YCXfVsprwboKwDCKHQ7GjSeZxAIhAJjk+LiJ3D9q1NLRgezi/8Afz6NxQ9v1nON+dgMqKz/k"}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/incident-1.1.1.tgz_1481887237579_0.9958135893102735"},"directories":{}},"1.2.0":{"name":"incident","version":"1.2.0","description":"Simple errors","main":"dist/lib/lib/incident.js","types":"dist/lib/lib/incident.d.ts","repository":{"type":"git","url":"git://github.com/demurgos/incident.git"},"scripts":{"prepare":"gulp all:tsconfig.json && gulp :tslint.json && gulp all:dist","test":"gulp :lint && gulp lib-test","prepublishOnly":"npm test",":lint":"gulp :lint","typedoc":"typedoc --includeDeclarations --out docs/api --module commonjs --target es2015 --exclude '**/*.spec.ts' --mode modules --name Incident --readme README.md src/lib/","gh-pages":"rm -rf build/gh-pages/ && typedoc --includeDeclarations --out build/gh-pages/ --module commonjs --target es2015 --exclude '**/*.spec.ts' --mode modules --name Incident --readme README.md src/lib/ && touch build/gh-pages/.nojekyll && cp -r build/gh-pages/. dist/gh-pages/"},"keywords":["error"],"pre-commit":{"run":["test"]},"author":"","license":"MIT","devDependencies":{"@types/chai":"^3.5.1","@types/mocha":"^2.2.41","chai":"^3.5.0","demurgos-web-build-tools":"0.13.0-beta.5","gulp":"github:gulpjs/gulp#4.0","pre-commit":"^1.2.2","typescript":"^2.1.4"},"gitHead":"dae23cf0b34ec57ec7c208aee8516f69ed4819dc","bugs":{"url":"https://github.com/demurgos/incident/issues"},"homepage":"https://github.com/demurgos/incident#readme","_id":"incident@1.2.0","_shasum":"d4f98dadfe11d0432444a899f9ad53d2abda490a","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.9.0","_npmUser":{"name":"demurgos","email":"demurgos@demurgos.net"},"dist":{"shasum":"d4f98dadfe11d0432444a899f9ad53d2abda490a","tarball":"https://registry.npmjs.org/incident/-/incident-1.2.0.tgz","integrity":"sha512-powzM0ZDxO354VAQv7xpO3V2mcMifjdepwsTSUnPHIYhqBVgawwGPqXmMgYS4f1Y4asuPTe268/zExtLrzXRVQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEaZd0gfbakJ+kL00QYVcAveQ9+gV4y0HlNHredpQLFTAiEA02jAl68kpt6EVbvEeFHJSwL8heCnux1eRwPHMSQcxoM="}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/incident-1.2.0.tgz_1492705116573_0.5509041880723089"},"directories":{}},"1.2.1":{"name":"incident","version":"1.2.1","description":"Simple powerful errors","main":"dist/lib-es2015/lib/incident.js","types":"dist/lib-es2015/lib/incident.d.ts","browser":"dist/lib-es5/lib/incident.js","repository":{"type":"git","url":"git://github.com/demurgos/incident.git"},"scripts":{"prepare":"gulp all:tsconfig.json && gulp :tslint.json && gulp all:dist","test":"gulp :lint && gulp lib-test","prepublishOnly":"npm test",":lint":"gulp :lint","typedoc":"typedoc --includeDeclarations --out docs/api --module commonjs --target es2015 --exclude '**/*.spec.ts' --mode modules --name Incident --readme README.md src/lib/","gh-pages":"rm -rf build/gh-pages/ && typedoc --includeDeclarations --out build/gh-pages/ --module commonjs --target es2015 --exclude '**/*.spec.ts' --mode modules --name Incident --readme README.md src/lib/ && touch build/gh-pages/.nojekyll && cp -r build/gh-pages/. dist/gh-pages/"},"keywords":["error"],"pre-commit":{"run":["test"]},"author":"","license":"MIT","devDependencies":{"@types/chai":"^3.5.1","@types/mocha":"^2.2.41","chai":"^3.5.0","demurgos-web-build-tools":"0.13.0-beta.5","gulp":"github:gulpjs/gulp#4.0","pre-commit":"^1.2.2","typescript":"^2.1.4"},"gitHead":"75c789b1622434e6ebcf49c4b8d97e7f0bf6cd09","bugs":{"url":"https://github.com/demurgos/incident/issues"},"homepage":"https://github.com/demurgos/incident#readme","_id":"incident@1.2.1","_shasum":"0ed43dbe9aed8376b2581ee53fc56888c61bf858","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.9.0","_npmUser":{"name":"demurgos","email":"demurgos@demurgos.net"},"dist":{"shasum":"0ed43dbe9aed8376b2581ee53fc56888c61bf858","tarball":"https://registry.npmjs.org/incident/-/incident-1.2.1.tgz","integrity":"sha512-YwjVWG167nmlb4BvQARbFssRCiASIZ1MFQNg+P3ikhc52NTnK39RhmQ4ku/FMM6JG5Ybl339v41YPiq7+qGWig==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCce4cCUGtmrM+dZv+rwl3FvBpH9B30iV/R8OISIpijrQIgF9N1/p//gZm0PnYaKY/9nk012nKWNZHCikJUBJsQCNk="}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/incident-1.2.1.tgz_1492715411552_0.9561959463171661"},"directories":{}},"2.0.0":{"name":"incident","version":"2.0.0","description":"Simple powerful errors","main":"dist/lib-es2015/lib/index.js","types":"dist/lib-es2015/lib/index.d.ts","browser":"dist/lib-es5/lib/index.js","repository":{"type":"git","url":"git://github.com/demurgos/incident.git"},"scripts":{"prepare":"gulp all:tsconfig.json && gulp :tslint.json && gulp all:dist","test":"gulp :lint && gulp lib-test","prepublishOnly":"npm test",":lint":"gulp :lint","typedoc":"typedoc --includeDeclarations --out docs/api --module commonjs --target es2015 --exclude '**/*.spec.ts' --mode modules --name Incident --readme README.md src/lib/","gh-pages":"rm -rf build/gh-pages/ && typedoc --includeDeclarations --out build/gh-pages/ --module commonjs --target es2015 --exclude '**/*.spec.ts' --mode modules --name Incident --readme README.md src/lib/ && touch build/gh-pages/.nojekyll && cp -r build/gh-pages/. dist/gh-pages/"},"keywords":["error"],"pre-commit":{"run":["test"]},"author":"","license":"MIT","devDependencies":{"@types/chai":"^3.5.1","@types/mocha":"^2.2.41","chai":"^3.5.0","demurgos-web-build-tools":"0.13.0-beta.5","gulp":"github:gulpjs/gulp#4.0","pre-commit":"^1.2.2","typescript":"^2.2.2"},"gitHead":"8c5da52111c0fb1f8c3ba64472d7cafaeba6876d","bugs":{"url":"https://github.com/demurgos/incident/issues"},"homepage":"https://github.com/demurgos/incident#readme","_id":"incident@2.0.0","_shasum":"5098098ddf00969bbd8aca2b9126a8732bd50f74","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.9.0","_npmUser":{"name":"demurgos","email":"demurgos@demurgos.net"},"dist":{"shasum":"5098098ddf00969bbd8aca2b9126a8732bd50f74","tarball":"https://registry.npmjs.org/incident/-/incident-2.0.0.tgz","integrity":"sha512-SaneBcmF8RRUv6kONtURt4J58wJUJl8TWJdooEzPF7wEZprm6FGna5njhTxuxO6P5jKstBBjNkQ44YPfOrHyGw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClP7I7vT8S+XQNbCyNfu4F5cMlZcpphp8LJ/Ffvog4PAIhAKsbaB3lQFHwJiMgONj4Ha7pEKSksW9bhlhLBU6WkHqu"}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/incident-2.0.0.tgz_1492798841879_0.209590595215559"},"directories":{}},"2.0.0-build.47":{"name":"incident","version":"2.0.0-build.47","description":"Simple powerful errors","private":false,"main":"index","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/demurgos/incident.git"},"keywords":["error"],"pre-commit":{"run":["test"]},"author":{"name":"Charles Samborski","email":"demurgos@demurgos.net","url":"https://demurgos.net"},"license":"MIT","devDependencies":{"@types/chai":"^3.5.1","@types/mocha":"^2.2.41","chai":"^3.5.0","gulp":"github:gulpjs/gulp#4.0","minimist":"^1.2.0","pre-commit":"^1.2.2","ts-node":"^3.3.0","turbo-gulp":"^0.15.4","typescript":"^2.6.1"},"gitHead":"2c9d1a63a2d49d4d22cbaa4d1892cc45f72b5b21","bugs":{"url":"https://github.com/demurgos/incident/issues"},"homepage":"https://github.com/demurgos/incident#readme","_id":"incident@2.0.0-build.47","_npmVersion":"5.5.1","_nodeVersion":"9.1.0","_npmUser":{"name":"demurgos","email":"demurgos@demurgos.net"},"dist":{"integrity":"sha512-xpRZq3XnirhhTSLKqHvonJLakCBiqGbXbGaeN9Lv9eWgEuSU4h7uX2OkQX9ljRxMi38RcNfbIs46jIZNn6LPrA==","shasum":"38cfb95fd1b12e8e17330ceb576ed7342b468bbd","tarball":"https://registry.npmjs.org/incident/-/incident-2.0.0-build.47.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC3w1Bspub3V75xOzZpvae2UwOptIvCUwTcTkIgndNYHAiAG4SRWqLfGo9aUlV0tFuSVAJWq0S5WBpZpadHuWKt+2A=="}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/incident-2.0.0-build.47.tgz_1510347517684_0.6898751757107675"},"directories":{}},"2.0.0-build.52":{"name":"incident","version":"2.0.0-build.52","description":"Errors with superpowers","private":false,"main":"index","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/demurgos/incident.git"},"keywords":["error"],"pre-commit":{"run":["test"]},"author":{"name":"Charles Samborski","email":"demurgos@demurgos.net","url":"https://demurgos.net"},"license":"MIT","devDependencies":{"@types/chai":"^3.5.1","@types/mocha":"^2.2.41","chai":"^3.5.0","gulp":"github:gulpjs/gulp#4.0","minimist":"^1.2.0","pre-commit":"^1.2.2","ts-node":"^3.3.0","turbo-gulp":"^0.15.4","typescript":"^2.6.1"},"dependencies":{"@types/object-inspect":"^1.4.0","object-inspect":"^1.4.0"},"gitHead":"b80d30eadcf74ec21449f29db76d059f0f48e529","bugs":{"url":"https://github.com/demurgos/incident/issues"},"homepage":"https://github.com/demurgos/incident#readme","_id":"incident@2.0.0-build.52","_npmVersion":"5.5.1","_nodeVersion":"9.1.0","_npmUser":{"name":"demurgos","email":"demurgos@demurgos.net"},"dist":{"integrity":"sha512-ACSFxyycd6KGdEA1VCP+xlPNejwr87jCsa7id1HEV/n8qIgTn0Px5d0gjMM3kuZFm31d9RxyYVyMfPh5m+9HNw==","shasum":"ace8f30ed5fb14dbda5ab1ae165a814356fff394","tarball":"https://registry.npmjs.org/incident/-/incident-2.0.0-build.52.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrES1hy2zVjcjAi1gpUR902Io8E/grJP5U1xGsa67HWAIgXFSbjAKvVaPZtmP0EqRCnrA/5AKAeC3GwBBcjclMeoo="}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/incident-2.0.0-build.52.tgz_1510493196434_0.106903453823179"},"directories":{}},"3.0.0":{"name":"incident","version":"3.0.0","description":"Errors with superpowers","private":false,"main":"index","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/demurgos/incident.git"},"keywords":["error"],"pre-commit":{"run":["test"]},"author":{"name":"Charles Samborski","email":"demurgos@demurgos.net","url":"https://demurgos.net"},"license":"MIT","devDependencies":{"@types/chai":"^3.5.1","@types/mocha":"^2.2.41","chai":"^3.5.0","gulp":"github:gulpjs/gulp#4.0","minimist":"^1.2.0","pre-commit":"^1.2.2","ts-node":"^3.3.0","turbo-gulp":"^0.15.4","typescript":"^2.6.1"},"dependencies":{"@types/object-inspect":"^1.4.0","object-inspect":"^1.4.0"},"gitHead":"de1a1624243be54965094bb9fbb26a2cd9b2725a","bugs":{"url":"https://github.com/demurgos/incident/issues"},"homepage":"https://github.com/demurgos/incident#readme","_id":"incident@3.0.0","_npmVersion":"5.5.1","_nodeVersion":"9.1.0","_npmUser":{"name":"demurgos","email":"demurgos@demurgos.net"},"dist":{"integrity":"sha512-+Pudrvj1Z2MuUwXpBrngvPYfnx+n3TZ/1UGwwGiO6eJfSdRB7nugfTGty3ZWw9X3ufLwucL1Qkmkcly0BCm+/Q==","shasum":"a507b1b7f12fef0bb82b34800b297b16a2c1df36","tarball":"https://registry.npmjs.org/incident/-/incident-3.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICQs8PvW5qtuyx2idGKNmu59ebzy07pFzcc7HsneBOGJAiEAtcfMSdh+DhTqIQiW6uIaZ1ElDQMWSbs0kc2cmtGi6dA="}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/incident-3.0.0.tgz_1510495289791_0.6290559356566519"},"directories":{}},"3.0.0-build.64":{"name":"incident","version":"3.0.0-build.64","description":"Errors with superpowers","private":false,"main":"index","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/demurgos/incident.git"},"keywords":["error"],"pre-commit":{"run":["test"]},"author":{"name":"Charles Samborski","email":"demurgos@demurgos.net","url":"https://demurgos.net"},"license":"MIT","devDependencies":{"@types/chai":"^4.0.4","@types/mocha":"^2.2.41","chai":"^4.1.2","gulp":"github:gulpjs/gulp#4.0","gulp-cli":"^1.4.0","minimist":"^1.2.0","pre-commit":"^1.2.2","ts-node":"^3.3.0","turbo-gulp":"^0.15.4","typescript":"^2.6.1"},"dependencies":{"@types/object-inspect":"^1.4.0","object-inspect":"^1.4.0"},"gitHead":"150403b71019dcb27daa7fd618091012f1bb0bf9","bugs":{"url":"https://github.com/demurgos/incident/issues"},"homepage":"https://github.com/demurgos/incident#readme","_id":"incident@3.0.0-build.64","_npmVersion":"5.5.1","_nodeVersion":"9.1.0","_npmUser":{"name":"demurgos","email":"demurgos@demurgos.net"},"dist":{"integrity":"sha512-SecOjx7bMNMf0xNPnbIgmO07YfrWJlxk+7Ws1pU3y69SHiUoQT52aSnMCF+EtWiVWJursJZPWcCXiXqYyzxsSA==","shasum":"444d6413d0d5fd3728b5a636d9cab020ea0fdc08","tarball":"https://registry.npmjs.org/incident/-/incident-3.0.0-build.64.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC5Y+CXzg/KBWmskw+cZKjj0htvSC68ilBZ2Xme+VIRyAiEA6ynZb57TMJ1LAHTzepulpXnkgSThDe1OE5PkSOPuAR0="}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/incident-3.0.0-build.64.tgz_1510585480648_0.6792406409513205"},"directories":{}},"3.0.0-build.66":{"name":"incident","version":"3.0.0-build.66","description":"Errors with superpowers","private":false,"main":"index","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/demurgos/incident.git"},"nyc":{"include":["build/test/lib/**/*.js"],"reporter":["text","html"]},"keywords":["error"],"pre-commit":{"run":["test"]},"author":{"name":"Charles Samborski","email":"demurgos@demurgos.net","url":"https://demurgos.net"},"license":"MIT","devDependencies":{"@types/chai":"^4.0.4","@types/mocha":"^2.2.41","chai":"^4.1.2","codecov":"^3.0.0","gulp":"github:gulpjs/gulp#4.0","gulp-cli":"^1.4.0","minimist":"^1.2.0","pre-commit":"^1.2.2","ts-node":"^3.3.0","turbo-gulp":"^0.15.7","typescript":"^2.6.1"},"dependencies":{"@types/object-inspect":"^1.4.0","object-inspect":"^1.4.0"},"gitHead":"8063c26fb1b9bff0309c4d66184cbab0c11b6afe","bugs":{"url":"https://github.com/demurgos/incident/issues"},"homepage":"https://github.com/demurgos/incident#readme","_id":"incident@3.0.0-build.66","_npmVersion":"5.5.1","_nodeVersion":"9.2.0","_npmUser":{"name":"demurgos","email":"demurgos@demurgos.net"},"dist":{"integrity":"sha512-NJDKDnZG3YFSToiVntVjp+CQi2laSiAnWUSZzEbKLckCOXJjj7kVmi+O3sdXwP/Mnjt+F/mOPY5MraLY77x+ug==","shasum":"c5c10c92afbd8a3a5274d29ec1f8ea7c88419726","tarball":"https://registry.npmjs.org/incident/-/incident-3.0.0-build.66.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZywZyyxYH5w0ZwlZ7l/IRKBGTEPDsfne6RbCqDHBjJwIgAmzaEB8qNXJTe/3lPwfc5nTro3yygbD5zLmiRyrW5NQ="}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/incident-3.0.0-build.66.tgz_1511987231849_0.9393744161352515"},"directories":{}},"3.0.0-build.76":{"name":"incident","version":"3.0.0-build.76","description":"Errors with superpowers","private":false,"main":"index","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/demurgos/incident.git"},"nyc":{"include":["build/test/lib/**/*.js"],"reporter":["text","html"]},"keywords":["error"],"pre-commit":{"run":["test"]},"author":{"name":"Charles Samborski","email":"demurgos@demurgos.net","url":"https://demurgos.net"},"license":"MIT","devDependencies":{"@types/chai":"^4.0.4","@types/mocha":"^2.2.41","chai":"^4.1.2","codecov":"^3.0.0","gulp":"github:gulpjs/gulp#4.0","gulp-cli":"^1.4.0","minimist":"^1.2.0","pre-commit":"^1.2.2","ts-node":"^4.0.0","turbo-gulp":"^0.15.7","typescript":"^2.6.1"},"dependencies":{"@types/object-inspect":"^1.4.0","object-inspect":"^1.4.0"},"gitHead":"5f491e52f7dd911aef09397771797433ed47c82a","bugs":{"url":"https://github.com/demurgos/incident/issues"},"homepage":"https://github.com/demurgos/incident#readme","_id":"incident@3.0.0-build.76","_npmVersion":"5.5.1","_nodeVersion":"9.2.1","_npmUser":{"name":"demurgos","email":"demurgos@demurgos.net"},"dist":{"integrity":"sha512-EkxLaEeHaPTWhnhjVuyCJNbv1yMODdT+atdW1dsD1GE3G7Jj3HHMZi9hfhD2noVUFYVGLBXv5PMO+PZwXFNJAw==","shasum":"8c3e9776ccc7c96eec28f4a66092dafc9784eeb0","tarball":"https://registry.npmjs.org/incident/-/incident-3.0.0-build.76.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqUAPzC00IVgVyo7duSeumFnept7lRPna+TJM7EkdEXwIgDR+a9+D2Tl18j4gvJPLaEspVKRAy1ai+9arNqXxMhtU="}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/incident-3.0.0-build.76.tgz_1512949432774_0.17769474117085338"},"directories":{}},"3.0.0-build.80":{"name":"incident","version":"3.0.0-build.80","description":"Errors with superpowers","private":false,"main":"index","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/demurgos/incident.git"},"nyc":{"include":["build/test/lib/**/*.js"],"reporter":["text","html"]},"keywords":["error"],"pre-commit":{"run":["test"]},"author":{"name":"Charles Samborski","email":"demurgos@demurgos.net","url":"https://demurgos.net"},"license":"MIT","devDependencies":{"@types/chai":"^4.0.4","@types/mocha":"^2.2.41","chai":"^4.1.2","codecov":"^3.0.0","gulp":"github:gulpjs/gulp#4.0","gulp-cli":"^1.4.0","minimist":"^1.2.0","pre-commit":"^1.2.2","ts-node":"^4.0.2","turbo-gulp":"^0.15.7","typescript":"^2.6.1"},"dependencies":{"@types/object-inspect":"^1.4.0","object-inspect":"^1.4.0"},"gitHead":"2dbf905e325a1a0c6dd734634f1577baee6c26b3","bugs":{"url":"https://github.com/demurgos/incident/issues"},"homepage":"https://github.com/demurgos/incident#readme","_id":"incident@3.0.0-build.80","_npmVersion":"5.5.1","_nodeVersion":"9.3.0","_npmUser":{"name":"demurgos","email":"demurgos@demurgos.net"},"dist":{"integrity":"sha512-4wCQIq2CIj/fPB+MlPYCJZ/o1Ne3/WVnJKRHaxwrCe9omAwdhtaGD52G8QWH2+SbohnuLunFBvQYy44iDcjcaw==","shasum":"f29fc66a87bf1efc0df9882c571c78facbef690d","tarball":"https://registry.npmjs.org/incident/-/incident-3.0.0-build.80.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1X3w7JYgGbV7Sz/eg2A506J20RFVhO2aEMIpcsF6VdAIhAPktaYFi0DIhxEUZC4SUaGlkkXaVYwG5qx82z0e+bPAp"}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/incident-3.0.0-build.80.tgz_1513679910750_0.6390010186005384"},"directories":{}},"3.0.0-build.82":{"name":"incident","version":"3.0.0-build.82","description":"Errors with superpowers","private":false,"main":"index","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/demurgos/incident.git"},"nyc":{"include":["build/test/lib/**/*.js"],"reporter":["text","html"]},"keywords":["error"],"pre-commit":{"run":["test"]},"author":{"name":"Charles Samborski","email":"demurgos@demurgos.net","url":"https://demurgos.net"},"license":"MIT","devDependencies":{"@types/chai":"^4.0.4","@types/mocha":"^2.2.41","chai":"^4.1.2","codecov":"^3.0.0","gulp":"github:gulpjs/gulp#4.0","gulp-cli":"^2.0.0","minimist":"^1.2.0","pre-commit":"^1.2.2","ts-node":"^4.0.2","turbo-gulp":"^0.15.7","typescript":"^2.6.1"},"dependencies":{"@types/object-inspect":"^1.4.0","object-inspect":"^1.4.0"},"gitHead":"cb4501a40e9ebfa20994ef81a434397286e1c84e","bugs":{"url":"https://github.com/demurgos/incident/issues"},"homepage":"https://github.com/demurgos/incident#readme","_id":"incident@3.0.0-build.82","_npmVersion":"5.5.1","_nodeVersion":"9.3.0","_npmUser":{"name":"demurgos","email":"demurgos@demurgos.net"},"dist":{"integrity":"sha512-IuGnmu2lGKFDuTUu0REMmpw4nRQII+9fwcNte2pLgiR+x5e6GWuZwn86F/bgsVnW/CCZ7POYUhxk7M7jSjCPPg==","shasum":"81c83d5701a4dae436ba53573b9ca5d94efb2173","tarball":"https://registry.npmjs.org/incident/-/incident-3.0.0-build.82.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBIJvU7UjoYKhgUQ88qiwT1YIfxs76N1jKEzBoF+Yl51AiEAlvcBECtVfBgtVRaTbLGSrcj0f27ALJYIDhUJoYZ756o="}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/incident-3.0.0-build.82.tgz_1513895806207_0.6025561166461557"},"directories":{}},"3.0.1-build.84":{"name":"incident","version":"3.0.1-build.84","description":"Errors with superpowers","private":false,"main":"index","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/demurgos/incident.git"},"nyc":{"include":["build/test/lib/**/*.js"],"reporter":["text","html"]},"keywords":["error"],"pre-commit":{"run":["test"]},"author":{"name":"Charles Samborski","email":"demurgos@demurgos.net","url":"https://demurgos.net"},"license":"MIT","dependencies":{"@types/object-inspect":"^1.4.0","object-inspect":"^1.4.0"},"devDependencies":{"@types/chai":"^4.0.4","@types/mocha":"^2.2.41","chai":"^4.1.2","codecov":"^3.0.0","gulp":"github:gulpjs/gulp#4.0","gulp-cli":"^1.4.0","minimist":"^1.2.0","pre-commit":"^1.2.2","ts-node":"^4.0.2","turbo-gulp":"^0.15.7","typescript":"^2.6.1"},"gitHead":"d8ecdc66967aad363c6f5dd45d104f99f24502ad","bugs":{"url":"https://github.com/demurgos/incident/issues"},"homepage":"https://github.com/demurgos/incident#readme","_id":"incident@3.0.1-build.84","_npmVersion":"5.5.1","_nodeVersion":"9.3.0","_npmUser":{"name":"demurgos","email":"demurgos@demurgos.net"},"dist":{"integrity":"sha512-en+p31esD7WPJRYPFu1VkLaK0mRHPE+xBpr7VDkzi+PMCfUSrMXvRKSn2BLijkCykqsnHC/DUU7NQb+awde8dg==","shasum":"050e9e83cda1651e206ffd1ca19376ef5b937a1a","tarball":"https://registry.npmjs.org/incident/-/incident-3.0.1-build.84.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBbIya60tIiw2HzGPRUYJOFA8rWi5MDE93xr32gLIrCsAiEA7zNruHgKrFYgOyKyLKMYqH5FPkZVB1cvAm4HKbzjl8A="}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/incident-3.0.1-build.84.tgz_1514889944008_0.03709762077778578"},"directories":{}},"3.0.1":{"name":"incident","version":"3.0.1","description":"Errors with superpowers","private":false,"main":"index","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/demurgos/incident.git"},"nyc":{"include":["build/test/lib/**/*.js"],"reporter":["text","html"]},"keywords":["error"],"pre-commit":{"run":["test"]},"author":{"name":"Charles Samborski","email":"demurgos@demurgos.net","url":"https://demurgos.net"},"license":"MIT","dependencies":{"@types/object-inspect":"^1.4.0","object-inspect":"^1.4.0"},"devDependencies":{"@types/chai":"^4.0.4","@types/mocha":"^2.2.41","chai":"^4.1.2","codecov":"^3.0.0","gulp":"github:gulpjs/gulp#4.0","gulp-cli":"^1.4.0","minimist":"^1.2.0","pre-commit":"^1.2.2","ts-node":"^4.0.2","turbo-gulp":"^0.15.7","typescript":"^2.6.1"},"gitHead":"8f1877ef2438c445244dab919bf83e7448c3049b","bugs":{"url":"https://github.com/demurgos/incident/issues"},"homepage":"https://github.com/demurgos/incident#readme","_id":"incident@3.0.1","_npmVersion":"5.5.1","_nodeVersion":"9.3.0","_npmUser":{"name":"demurgos","email":"demurgos@demurgos.net"},"dist":{"integrity":"sha512-SmR2XZh+87+JWZQzFiU41W7svA+xBDTvSyRGA/vhyyZ/TVWTX76WqaFo6dYoTLxDqoOJ3/G1O0hyMsv5eBhlyg==","shasum":"3c4f89ca6593e24159602fb3ed4588a01b6ce767","tarball":"https://registry.npmjs.org/incident/-/incident-3.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDPreWSz1ThKKSA6tpQ4X2wlX4hf8b3M5HfFDL2QR8FrwIgYlXtgwXlIWtkuTyWBP/r3ipzcmYD3kSmdauP1+auNes="}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/incident-3.0.1.tgz_1514890523787_0.7555472156964242"},"directories":{}},"3.0.1-build.89":{"name":"incident","version":"3.0.1-build.89","description":"Errors with superpowers","private":false,"main":"index","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/demurgos/incident.git"},"nyc":{"include":["build/test/lib/**/*.js"],"reporter":["text","html"]},"keywords":["error"],"pre-commit":{"run":["test"]},"author":{"name":"Charles Samborski","email":"demurgos@demurgos.net","url":"https://demurgos.net"},"license":"MIT","dependencies":{"@types/object-inspect":"^1.4.0","object-inspect":"^1.4.0"},"devDependencies":{"@types/chai":"^4.1.0","@types/mocha":"^2.2.46","chai":"^4.1.2","codecov":"^3.0.0","gulp":"^4.0.0","gulp-cli":"^2.0.0","minimist":"^1.2.0","pre-commit":"^1.2.2","ts-node":"^4.0.2","turbo-gulp":"^0.15.7","typescript":"2.7.0-dev.20180109"},"gitHead":"b214bd2238d6920c26a690c333cc1116f963cdf3","bugs":{"url":"https://github.com/demurgos/incident/issues"},"homepage":"https://github.com/demurgos/incident#readme","_id":"incident@3.0.1-build.89","_npmVersion":"5.5.1","_nodeVersion":"9.3.0","_npmUser":{"name":"demurgos","email":"demurgos@demurgos.net"},"dist":{"integrity":"sha512-R8IDzRHfobub0HoAliGC25RS0UDMGblvlUvpg4LKGbZxD0V/E56bkRTL9ISPj+BHwX73KQAevZEtJ95ChneFLg==","shasum":"705a3e75ac27d19987c868778d433d4165ac1c46","tarball":"https://registry.npmjs.org/incident/-/incident-3.0.1-build.89.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE/HcafdFP70h5ElqAEtcYFczntNlkmLyIkRNy1SZ8m1AiEA09Qc8Y3SEkIpiBko8rijdKMqQpybGIifK3xE4pFuyW0="}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/incident-3.0.1-build.89.tgz_1515527050069_0.651031210552901"},"directories":{}},"3.1.0":{"name":"incident","version":"3.1.0","description":"Errors with superpowers","private":false,"main":"index","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/demurgos/incident.git"},"nyc":{"include":["build/test/lib/**/*.js"],"reporter":["text","html"]},"keywords":["error"],"pre-commit":{"run":["test"]},"author":{"name":"Charles Samborski","email":"demurgos@demurgos.net","url":"https://demurgos.net"},"license":"MIT","dependencies":{"@types/object-inspect":"^1.4.0","object-inspect":"^1.4.0"},"devDependencies":{"@types/chai":"^4.1.0","@types/mocha":"^2.2.46","chai":"^4.1.2","codecov":"^3.0.0","gulp":"^4.0.0","gulp-cli":"^2.0.0","minimist":"^1.2.0","pre-commit":"^1.2.2","ts-node":"^4.0.2","turbo-gulp":"^0.15.7","typescript":"2.7.0-dev.20180109"},"gitHead":"c56fbe9d418d94da56944e6cad4d79de79055e4a","bugs":{"url":"https://github.com/demurgos/incident/issues"},"homepage":"https://github.com/demurgos/incident#readme","_id":"incident@3.1.0","_npmVersion":"5.5.1","_nodeVersion":"9.3.0","_npmUser":{"name":"demurgos","email":"demurgos@demurgos.net"},"dist":{"integrity":"sha512-PL/CZWCx6jwvCuoGWp5Za4AQdqpSVbD0e4TiYnRV406aw6dlYP26+/yUMLmv/KEvtlLzgSEx7GvnQqmYMqE+xg==","shasum":"4c19fcb436d7e0aff381870b1f1d8258c123c5f9","tarball":"https://registry.npmjs.org/incident/-/incident-3.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFQ8UwV9JpVlTJFTPHiwOqQHYYOZexrlzzch5cAN4AskAiEAsTTvPOqsA73Fx229molhKIPSDFfqXpI8FuPy30TYg/I="}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/incident-3.1.0.tgz_1515529090876_0.4121957377064973"},"directories":{}},"3.1.0-build.103":{"name":"incident","version":"3.1.0-build.103","description":"Errors with superpowers","private":false,"main":"index","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/demurgos/incident.git"},"nyc":{"include":["build/test/lib/**/*.js"],"reporter":["text","html"]},"keywords":["error"],"pre-commit":{"run":["test"]},"author":{"name":"Charles Samborski","email":"demurgos@demurgos.net","url":"https://demurgos.net"},"license":"MIT","dependencies":{"@types/object-inspect":"^1.4.0","object-inspect":"^1.4.0"},"devDependencies":{"@types/chai":"^4.1.0","@types/mocha":"^2.2.46","chai":"^4.1.2","codecov":"^3.0.0","gulp":"^4.0.0","gulp-cli":"^2.0.0","minimist":"^1.2.0","pre-commit":"^1.2.2","ts-node":"^4.0.2","turbo-gulp":"^0.16.0","typescript":"2.7.0-dev.20180109"},"gitHead":"3903915dd2a2f621f2d12f0e5289521ec299dad1","bugs":{"url":"https://github.com/demurgos/incident/issues"},"homepage":"https://github.com/demurgos/incident#readme","_id":"incident@3.1.0-build.103","_npmVersion":"5.6.0","_nodeVersion":"9.4.0","_npmUser":{"name":"demurgos","email":"demurgos@demurgos.net"},"dist":{"integrity":"sha512-/0Ss02KjflpreO7E4MnIbOaaCSaBN1/aly1/4dViNuZYngGCmTP/rWgx8jt0iU0IwF1Gr23aT/XR//uByrQFiw==","shasum":"cfcab05a7d1ccf39f78f7eb6205467335e8c5ff7","tarball":"https://registry.npmjs.org/incident/-/incident-3.1.0-build.103.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIETThG9fohnCL3XIsS1EcN4qsrPOiAWy123EbXoYvTavAiAyQE9woahK/bBOvCXrNV+YHGSqOlInVqSJx9ajJUxcFA=="}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/incident-3.1.0-build.103.tgz_1515625563162_0.8977015546988696"},"directories":{}},"3.1.1-build.108":{"name":"incident","version":"3.1.1-build.108","description":"Errors with superpowers","private":false,"main":"index","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/demurgos/incident.git"},"nyc":{"include":["build/test/lib/**/*.js"],"reporter":["text","html"]},"keywords":["error"],"pre-commit":{"run":["test"]},"author":{"name":"Charles Samborski","email":"demurgos@demurgos.net","url":"https://demurgos.net"},"license":"MIT","dependencies":{"@types/object-inspect":"^1.4.0","object-inspect":"^1.5.0"},"devDependencies":{"@types/chai":"^4.1.2","@types/mocha":"^2.2.48","chai":"^4.1.2","codecov":"^3.0.0","gulp":"^4.0.0","gulp-cli":"^2.0.1","minimist":"^1.2.0","pre-commit":"^1.2.2","ts-node":"^4.1.0","turbo-gulp":"^0.16.2","typescript":"^2.7.1"},"gitHead":"2ccb879449b9c56b09d05102f4e10cf37c5822dc","readme":"# Incident\n\n[![npm](https://img.shields.io/npm/v/incident.svg?maxAge=2592000)](https://www.npmjs.com/package/incident)\n[![GitHub repository](https://img.shields.io/badge/Github-demurgos%2Fincident-blue.svg)](https://github.com/demurgos/incident)\n[![Build status](https://img.shields.io/travis/demurgos/incident/master.svg?maxAge=2592000)](https://travis-ci.org/demurgos/incident)\n[![Codecov](https://codecov.io/gh/demurgos/incident/branch/master/graph/badge.svg)](https://codecov.io/gh/demurgos/incident)\n[![Greenkeeper badge](https://badges.greenkeeper.io/demurgos/incident.svg)](https://greenkeeper.io/)\n\nErrors with superpowers.\n\n## Installation\n\n```shell\nnpm install --save incident\n```\n\n## Features\n\n- Node and browser support.\n- Supports `instanceof Error` tests.\n- Built-in error causality tracking.\n- **Compatible with Typescript discriminated unions**. If you type the name, you can then use it\n  as a discriminant property to resolve the type of the data and cause.\n  See the example  below.\n- Compatible with prototypal inheritance and ES6 class inheritance\n- Distributed with type definitions for Typescript\n- Lazy stack capture and support for lazy message formatter: never called if not needed\n- Minimal dependencies: has a single dependency on [object-inspect](https://github.com/substack/object-inspect)\n- Tiny: 3kB minized, 1kB gziped\n\n## Migration from version 2\n\nEnsure that each of you always provide a `name`. You should mainly look for `new Incident(message)` and\n`new Incident(cause, message)` which would be interpreted as `new Incident(name)` and `new Incident(cause, name)`\nin version 3.\nAlso note that the order of the generic parameters changed from `<Name, Data, Cause>` to `<Data, Name, Cause>`.\n\n## Why\n\nMy goal with this library was to simplify the automatic handling of errors and\nprovide better error messages. Javascript errors are not very helpful because extending\nthem and then extracting data is tedious because you need a declaration statement,\nmultiple assignations, and then match on the name that is usually the generic `\"Error\"`\nor rely on a brittle `instance of`.\n\nTo achieve automatic error handling, the information describing the error should\nbe easily accessible programmatically. That's why you can directly pass a data object\nto the `Incident` constructor. Being able to pass data on the fly means that you do not need a\ndeclaration statement for the error separate property assignations. A key identifying the error\nis the second requirement for automatic error handling, `Incident` simply uses the name.\nAs explained in the features, it allows to unambiguously identify the error (I'd recommend to\nalways use a name). Using a name (as a string enum variant) is also more reliable than using\n`instance of` (prototype chain lookup) to check for the type of custom errors. The two main\nadvantages are that it's easier to serialize / deserialize and is not affected by the module\nduplication of the Node module resolution algorithm.\n\nTo provide better error messages, especially for asynchronous operations, I made the cause\nof the error a first-class information. It allows to deal with deferred or wrapped errors\nmore pleasant: the stack trace at each step is preserved.\n\nThe library is already pretty verbose (I am waiting for generic defaults in TS 2.3) so\nI'd like to keep the usage simple. For example, I have experimented with a arrays of causes (when\nan error has multiple simultaneous causes).\nThe displayed messages were pretty good but it made the code to handle the errors automatically\npretty complex because the type for the cause was `Error | Error[] | undefined`.\nThis feature did not even make it to the version 1. If you need it, but your multiple reasons\nin the `data` object.\n\nFinally, performance is also a goal. That's why the library performs late / lazy stack capture\nand allows for message formatters that are called only when needed.\n\n## Usage\n\n### Exports\n\n```typescript\nfunction Incident; // The Incident constructor\ninterface StaticIncident; // Interface of the constructor\ninterface Incident; // Interface of the instance\n```\n\n### `Incident`\n\nAn `Incident` has the following interface:\n\n```typescript\ninterface Incident<\n  Data extends object,\n  Name extends string = string,\n  Cause extends (Error | undefined) = (Error | undefined)\n> extends Error {\n  name: Name;\n  message: string;\n  data: Data;\n  cause: Cause;\n  stack: string;\n  toString(): string;\n}\n```\n\n### Generic parameters\n\n- **Name**: The type of the name, use a literal string type to be able to switch\n  ont the name and benefit from Typescript's type discrimination.\n- **Data**: The interface of the data associated to this error. Must respect `typeof data === \"object\"`\n- **Cause**: The type of the error cause. Use `undefined` if there is no cause.\n\n### Attributes\n\n#### `name`\n\nA name uniquely identifying the error. Displayed at the top of the stack.\n\n#### `message`\n\nA debug message for developers describing the error. Displayed at the top of the stack.\nIf you provide `data` but no `message`, the message will be generate from the data using\n[object-inspect](https://github.com/substack/object-inspect) with default options.\n\n#### `data`\n\nA data object associated to the error. This should describe the error enough\nto handle it programmatically.\n\n#### `cause`\n\nA previous error that cause this error. This usually has more detail about\nwhat happened.\n\n#### `stack`\n\nThe error stack of the incident. Contains the standard stack frames, and the\nstack of the cause if there is any.\n\n### Constructor\n\n```typescript\nnew Incident<Data, Name, Cause>([cause,] name, [data,] [message]);\n```\n\nYou can pass almost any combination of parameters you want as long as it is in the\nright order (see table below for the details) and a name is specified. If you want\nto explicitly define the generic parameters, you don't have to define the generic\nparameter for a function parameter you do not use. Instanciating a new Incident\ninstance will perform a lazy capture of the current call stack (only resolved when\nreading `.stack` or throwing the error).\n\n- **cause**\n  - Type: `Cause`\n  - Type constraint: If you provide a `cause`, `Cause extends Error` else `Cause` is `undefined`.\n  - Default type: `undefined`\n  - Default value: `undefined`\n  - Description: A previous error that caused this Incident.\n\n- **name**\n  - Type: `Name`\n  - Type constraint: `Name extends string`\n  - Default type: `string`\n  - **Required**\n  - Description: A name allowing to discriminate the error data and cause.\n\n- **data**\n  - Type: `Data`\n  - Type constraint: `Data extends object`\n  - Default type: `object`\n  - Default value: `{}`\n  - Description: A data object completely describing the error.\n\n- **message**\n  - Type: `string | ((data?: typeof data) => string)`\n  - Default value: `\"\"`\n  - Description: A debug message for developers. If the message is a formatter function,\n    it will be lazily evaluated (only once) when:\n    - the `message` property is accessed\n    - the `stack` property is accessed\n    - the error is thrown\n\n\n`new` operator signatures table\n\n|cause|name |data |message| Comment                                                  |\n|:---:|:---:|:---:|:-----:|:---------------------------------------------------------|\n|     |  ✔  |     |       |`new<Name>(...): Incident<Name, object, undefined>`       |\n|     |  ✔  |     |   ✔   |`new<Name>(...): Incident<Name, object, undefined>`       |\n|     |  ✔  |  ✔  |       |`new<Data, Name>(...): Incident<Name, Data, undefined>`   |\n|     |  ✔  |  ✔  |   ✔   |`new<Data, Name>(...): Incident<Name, Data, undefined>`   |\n|  ✔  |  ✔  |     |       |`new<Name, Cause>(...): Incident<Name, object, Cause>`    |\n|  ✔  |  ✔  |     |   ✔   |`new<Name, Cause>(...): Incident<Name, object, Cause>`    |\n|  ✔  |  ✔  |  ✔  |       |`new<Data, Name, Cause>(...): Incident<Name, Data, Cause>`|\n|  ✔  |  ✔  |  ✔  |   ✔   |`new<Data, Name, Cause>(...): Incident<Name, Data, Cause>`|\n\n### Call\n\nYou can call `Incident` as a simple function. It has the same signature as\nthe `new` operator but **does not capture the stack**. You may want to use\nit for higher order errors, but I recommend to capture the stack for root causes.\n\nThe simple call also supports the additional signature `(cause: Error)`.\nThis will perform a conversion from any error to an instance of the currently called\nIncident. You can use it normalize simple errors to Incident or mitigate module\nduplication if you rely on `instanceof`. The resulting incident will have the\nsame name, message, stack and data. If the input error was an Incident with\na lazy message or stack, it will remain non-evaluated.\nIf the argument is already an instance of the current `Incident`, a copy will be\ncreated. If you added extra properties, they will be lost.\n\n|cause|name |data |message| Comment                                                  |\n|:---:|:---:|:---:|:-----:|:---------------------------------------------------------|\n|  ✔  |     |     |       |**Converts to an instance of this `Incident` constructor**|\n|     |  ✔  |     |       |`<Name>(...): Incident<Name, object, undefined>`          |\n|     |  ✔  |     |   ✔   |`<Name>(...): Incident<Name, object, undefined>`          |\n|     |  ✔  |  ✔  |       |`<Data, Name>(...): Incident<Name, Data, undefined>`      |\n|     |  ✔  |  ✔  |   ✔   |`<Data, Name>(...): Incident<Name, Data, undefined>`      |\n|  ✔  |  ✔  |     |       |`<Name, Cause>(...): Incident<Name, object, Cause>`       |\n|  ✔  |  ✔  |     |   ✔   |`<Name, Cause>(...): Incident<Name, object, Cause>`       |\n|  ✔  |  ✔  |  ✔  |       |`<Data, Name, Cause>(...): Incident<Name, Data, Cause>`   |\n|  ✔  |  ✔  |  ✔  |   ✔   |`<Data, Name, Cause>(...): Incident<Name, Data, Cause>`   |\n\n## Discriminated union\n\n```typescript\n// Example of type resolution on a discriminated type\nimport Incident from \"incident\";\n\n// Associate the name \"SyntaxError\" to {index: number}\ntype SyntaxError = Incident<\"SyntaxError\", {index: number}, undefined>;\n// Associate the name \"TypeError\" to {typeName: string}\ntype TypeError = Incident<\"TypeError\", {typeName: string}, undefined>;\n// Created a discriminated type\ntype BaseError = SyntaxError | TypeError;\n\n// Example usage accepting the discriminated type\nfunction printError(error: BaseError): void {\n  // Switch on the discriminant\n  switch (error.name) {\n    case \"SyntaxError\":\n      // No need to cast: successfully resolved to SyntaxError\n      const index: number = error.data.index;\n      console.log(`Received a syntax error with index: ${index}`);\n      break;\n    case \"TypeError\":\n      // Successfully resolved to TypeError\n      const typename: string = error.data.typeName;\n      console.log(`Received a type error with typename: ${typename}`);\n      break;\n  }\n}\n```\n\n## License\n\n[MIT License](./LICENSE.md)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/demurgos/incident/issues"},"homepage":"https://github.com/demurgos/incident#readme","_id":"incident@3.1.1-build.108","_npmVersion":"5.6.0","_nodeVersion":"9.5.0","_npmUser":{"name":"demurgos","email":"demurgos@demurgos.net"},"dist":{"integrity":"sha512-N6104BkaxwLLCBt4Kwxs5DbXplfXm4erc+VDk713J0JBs45MmDsBeXENnSsWJI1rnPImbq6G6oHrZ7Btuy+IzQ==","shasum":"92821346902d8e7cf0d8baa18e58ba5244c76d2e","tarball":"https://registry.npmjs.org/incident/-/incident-3.1.1-build.108.tgz","fileCount":17,"unpackedSize":98505,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHrtqcvH3LBzByJCR2rJ4J2wlqFmVQAvtRERTyLQr1M2AiBGWInxEjCB9WMwTJMw/p9xz0hi4ixqwbHXP4uGEuUqFQ=="}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/incident_3.1.1-build.108_1518032319302_0.872177114248232"},"_hasShrinkwrap":false},"3.1.1":{"name":"incident","version":"3.1.1","description":"Errors with superpowers","private":false,"main":"index","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/demurgos/incident.git"},"nyc":{"include":["build/test/lib/**/*.js"],"reporter":["text","html"]},"keywords":["error"],"pre-commit":{"run":["test"]},"author":{"name":"Charles Samborski","email":"demurgos@demurgos.net","url":"https://demurgos.net"},"license":"MIT","dependencies":{"@types/object-inspect":"^1.4.0","object-inspect":"^1.5.0"},"devDependencies":{"@types/chai":"^4.1.2","@types/mocha":"^2.2.48","chai":"^4.1.2","codecov":"^3.0.0","gulp":"^4.0.0","gulp-cli":"^2.0.1","minimist":"^1.2.0","pre-commit":"^1.2.2","ts-node":"^4.1.0","turbo-gulp":"^0.16.2","typescript":"^2.7.1"},"gitHead":"333c95720c2b3b31ad3145de60a962e32f74950c","bugs":{"url":"https://github.com/demurgos/incident/issues"},"homepage":"https://github.com/demurgos/incident#readme","_id":"incident@3.1.1","_npmVersion":"5.6.0","_nodeVersion":"9.5.0","_npmUser":{"name":"demurgos","email":"demurgos@demurgos.net"},"dist":{"integrity":"sha512-6jVSlK2PdNCX2EuYDlTgu8ORDY3M5fHHfiWStMUQP2qjgxlqlanDmouKj+0Tjsy9mzra4RfqgIE0ZKCbvIRJqQ==","shasum":"b284e92ebad0499e2a1f154b9692ce963d89aaa3","tarball":"https://registry.npmjs.org/incident/-/incident-3.1.1.tgz","fileCount":17,"unpackedSize":98495,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHSfBZCVEz/II5ZVVroBvMvLhN8ili2trjlCEGwimKoiAiBG/Jivlbog0akTWhrc/YDE795YuL65IFJonVvDRQED5w=="}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/incident_3.1.1_1518033448877_0.7000604375808388"},"_hasShrinkwrap":false},"3.1.1-build.117":{"name":"incident","version":"3.1.1-build.117","description":"Errors with superpowers","private":false,"main":"index","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/demurgos/incident.git"},"nyc":{"include":["build/test/lib/**/*.js"],"reporter":["text","html"]},"keywords":["error"],"pre-commit":{"run":["test"]},"author":{"name":"Charles Samborski","email":"demurgos@demurgos.net","url":"https://demurgos.net"},"license":"MIT","dependencies":{"@types/object-inspect":"^1.4.0","object-inspect":"^1.5.0"},"devDependencies":{"@types/chai":"^4.1.2","@types/mocha":"^5.0.0","chai":"^4.1.2","codecov":"^3.0.0","gulp":"^4.0.0","gulp-cli":"^2.0.1","minimist":"^1.2.0","pre-commit":"^1.2.2","ts-node":"^4.1.0","turbo-gulp":"^0.16.2","typescript":"^2.7.1"},"gitHead":"65260c972336e49b5c94be5239400ec722446361","readme":"# Incident\n\n[![npm](https://img.shields.io/npm/v/incident.svg?maxAge=2592000)](https://www.npmjs.com/package/incident)\n[![GitHub repository](https://img.shields.io/badge/Github-demurgos%2Fincident-blue.svg)](https://github.com/demurgos/incident)\n[![Build status](https://img.shields.io/travis/demurgos/incident/master.svg?maxAge=2592000)](https://travis-ci.org/demurgos/incident)\n[![Codecov](https://codecov.io/gh/demurgos/incident/branch/master/graph/badge.svg)](https://codecov.io/gh/demurgos/incident)\n[![Greenkeeper badge](https://badges.greenkeeper.io/demurgos/incident.svg)](https://greenkeeper.io/)\n\nErrors with superpowers.\n\n## Installation\n\n```shell\nnpm install --save incident\n```\n\n## Features\n\n- Node and browser support.\n- Supports `instanceof Error` tests.\n- Built-in error causality tracking.\n- **Compatible with Typescript discriminated unions**. If you type the name, you can then use it\n  as a discriminant property to resolve the type of the data and cause.\n  See the example  below.\n- Compatible with prototypal inheritance and ES6 class inheritance\n- Distributed with type definitions for Typescript\n- Lazy stack capture and support for lazy message formatter: never called if not needed\n- Minimal dependencies: has a single dependency on [object-inspect](https://github.com/substack/object-inspect)\n- Tiny: 3kB minized, 1kB gziped\n\n## Migration from version 2\n\nEnsure that each of you always provide a `name`. You should mainly look for `new Incident(message)` and\n`new Incident(cause, message)` which would be interpreted as `new Incident(name)` and `new Incident(cause, name)`\nin version 3.\nAlso note that the order of the generic parameters changed from `<Name, Data, Cause>` to `<Data, Name, Cause>`.\n\n## Why\n\nMy goal with this library was to simplify the automatic handling of errors and\nprovide better error messages. Javascript errors are not very helpful because extending\nthem and then extracting data is tedious because you need a declaration statement,\nmultiple assignations, and then match on the name that is usually the generic `\"Error\"`\nor rely on a brittle `instance of`.\n\nTo achieve automatic error handling, the information describing the error should\nbe easily accessible programmatically. That's why you can directly pass a data object\nto the `Incident` constructor. Being able to pass data on the fly means that you do not need a\ndeclaration statement for the error separate property assignations. A key identifying the error\nis the second requirement for automatic error handling, `Incident` simply uses the name.\nAs explained in the features, it allows to unambiguously identify the error (I'd recommend to\nalways use a name). Using a name (as a string enum variant) is also more reliable than using\n`instance of` (prototype chain lookup) to check for the type of custom errors. The two main\nadvantages are that it's easier to serialize / deserialize and is not affected by the module\nduplication of the Node module resolution algorithm.\n\nTo provide better error messages, especially for asynchronous operations, I made the cause\nof the error a first-class information. It allows to deal with deferred or wrapped errors\nmore pleasant: the stack trace at each step is preserved.\n\nThe library is already pretty verbose (I am waiting for generic defaults in TS 2.3) so\nI'd like to keep the usage simple. For example, I have experimented with a arrays of causes (when\nan error has multiple simultaneous causes).\nThe displayed messages were pretty good but it made the code to handle the errors automatically\npretty complex because the type for the cause was `Error | Error[] | undefined`.\nThis feature did not even make it to the version 1. If you need it, but your multiple reasons\nin the `data` object.\n\nFinally, performance is also a goal. That's why the library performs late / lazy stack capture\nand allows for message formatters that are called only when needed.\n\n## Usage\n\n### Exports\n\n```typescript\nfunction Incident; // The Incident constructor\ninterface StaticIncident; // Interface of the constructor\ninterface Incident; // Interface of the instance\n```\n\n### `Incident`\n\nAn `Incident` has the following interface:\n\n```typescript\ninterface Incident<\n  Data extends object,\n  Name extends string = string,\n  Cause extends (Error | undefined) = (Error | undefined)\n> extends Error {\n  name: Name;\n  message: string;\n  data: Data;\n  cause: Cause;\n  stack: string;\n  toString(): string;\n}\n```\n\n### Generic parameters\n\n- **Name**: The type of the name, use a literal string type to be able to switch\n  ont the name and benefit from Typescript's type discrimination.\n- **Data**: The interface of the data associated to this error. Must respect `typeof data === \"object\"`\n- **Cause**: The type of the error cause. Use `undefined` if there is no cause.\n\n### Attributes\n\n#### `name`\n\nA name uniquely identifying the error. Displayed at the top of the stack.\n\n#### `message`\n\nA debug message for developers describing the error. Displayed at the top of the stack.\nIf you provide `data` but no `message`, the message will be generate from the data using\n[object-inspect](https://github.com/substack/object-inspect) with default options.\n\n#### `data`\n\nA data object associated to the error. This should describe the error enough\nto handle it programmatically.\n\n#### `cause`\n\nA previous error that cause this error. This usually has more detail about\nwhat happened.\n\n#### `stack`\n\nThe error stack of the incident. Contains the standard stack frames, and the\nstack of the cause if there is any.\n\n### Constructor\n\n```typescript\nnew Incident<Data, Name, Cause>([cause,] name, [data,] [message]);\n```\n\nYou can pass almost any combination of parameters you want as long as it is in the\nright order (see table below for the details) and a name is specified. If you want\nto explicitly define the generic parameters, you don't have to define the generic\nparameter for a function parameter you do not use. Instanciating a new Incident\ninstance will perform a lazy capture of the current call stack (only resolved when\nreading `.stack` or throwing the error).\n\n- **cause**\n  - Type: `Cause`\n  - Type constraint: If you provide a `cause`, `Cause extends Error` else `Cause` is `undefined`.\n  - Default type: `undefined`\n  - Default value: `undefined`\n  - Description: A previous error that caused this Incident.\n\n- **name**\n  - Type: `Name`\n  - Type constraint: `Name extends string`\n  - Default type: `string`\n  - **Required**\n  - Description: A name allowing to discriminate the error data and cause.\n\n- **data**\n  - Type: `Data`\n  - Type constraint: `Data extends object`\n  - Default type: `object`\n  - Default value: `{}`\n  - Description: A data object completely describing the error.\n\n- **message**\n  - Type: `string | ((data?: typeof data) => string)`\n  - Default value: `\"\"`\n  - Description: A debug message for developers. If the message is a formatter function,\n    it will be lazily evaluated (only once) when:\n    - the `message` property is accessed\n    - the `stack` property is accessed\n    - the error is thrown\n\n\n`new` operator signatures table\n\n|cause|name |data |message| Comment                                                  |\n|:---:|:---:|:---:|:-----:|:---------------------------------------------------------|\n|     |  ✔  |     |       |`new<Name>(...): Incident<Name, object, undefined>`       |\n|     |  ✔  |     |   ✔   |`new<Name>(...): Incident<Name, object, undefined>`       |\n|     |  ✔  |  ✔  |       |`new<Data, Name>(...): Incident<Name, Data, undefined>`   |\n|     |  ✔  |  ✔  |   ✔   |`new<Data, Name>(...): Incident<Name, Data, undefined>`   |\n|  ✔  |  ✔  |     |       |`new<Name, Cause>(...): Incident<Name, object, Cause>`    |\n|  ✔  |  ✔  |     |   ✔   |`new<Name, Cause>(...): Incident<Name, object, Cause>`    |\n|  ✔  |  ✔  |  ✔  |       |`new<Data, Name, Cause>(...): Incident<Name, Data, Cause>`|\n|  ✔  |  ✔  |  ✔  |   ✔   |`new<Data, Name, Cause>(...): Incident<Name, Data, Cause>`|\n\n### Call\n\nYou can call `Incident` as a simple function. It has the same signature as\nthe `new` operator but **does not capture the stack**. You may want to use\nit for higher order errors, but I recommend to capture the stack for root causes.\n\nThe simple call also supports the additional signature `(cause: Error)`.\nThis will perform a conversion from any error to an instance of the currently called\nIncident. You can use it normalize simple errors to Incident or mitigate module\nduplication if you rely on `instanceof`. The resulting incident will have the\nsame name, message, stack and data. If the input error was an Incident with\na lazy message or stack, it will remain non-evaluated.\nIf the argument is already an instance of the current `Incident`, a copy will be\ncreated. If you added extra properties, they will be lost.\n\n|cause|name |data |message| Comment                                                  |\n|:---:|:---:|:---:|:-----:|:---------------------------------------------------------|\n|  ✔  |     |     |       |**Converts to an instance of this `Incident` constructor**|\n|     |  ✔  |     |       |`<Name>(...): Incident<Name, object, undefined>`          |\n|     |  ✔  |     |   ✔   |`<Name>(...): Incident<Name, object, undefined>`          |\n|     |  ✔  |  ✔  |       |`<Data, Name>(...): Incident<Name, Data, undefined>`      |\n|     |  ✔  |  ✔  |   ✔   |`<Data, Name>(...): Incident<Name, Data, undefined>`      |\n|  ✔  |  ✔  |     |       |`<Name, Cause>(...): Incident<Name, object, Cause>`       |\n|  ✔  |  ✔  |     |   ✔   |`<Name, Cause>(...): Incident<Name, object, Cause>`       |\n|  ✔  |  ✔  |  ✔  |       |`<Data, Name, Cause>(...): Incident<Name, Data, Cause>`   |\n|  ✔  |  ✔  |  ✔  |   ✔   |`<Data, Name, Cause>(...): Incident<Name, Data, Cause>`   |\n\n## Discriminated union\n\n```typescript\n// Example of type resolution on a discriminated type\nimport Incident from \"incident\";\n\n// Associate the name \"SyntaxError\" to {index: number}\ntype SyntaxError = Incident<\"SyntaxError\", {index: number}, undefined>;\n// Associate the name \"TypeError\" to {typeName: string}\ntype TypeError = Incident<\"TypeError\", {typeName: string}, undefined>;\n// Created a discriminated type\ntype BaseError = SyntaxError | TypeError;\n\n// Example usage accepting the discriminated type\nfunction printError(error: BaseError): void {\n  // Switch on the discriminant\n  switch (error.name) {\n    case \"SyntaxError\":\n      // No need to cast: successfully resolved to SyntaxError\n      const index: number = error.data.index;\n      console.log(`Received a syntax error with index: ${index}`);\n      break;\n    case \"TypeError\":\n      // Successfully resolved to TypeError\n      const typename: string = error.data.typeName;\n      console.log(`Received a type error with typename: ${typename}`);\n      break;\n  }\n}\n```\n\n## License\n\n[MIT License](./LICENSE.md)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/demurgos/incident/issues"},"homepage":"https://github.com/demurgos/incident#readme","_id":"incident@3.1.1-build.117","_npmVersion":"5.6.0","_nodeVersion":"9.9.0","_npmUser":{"name":"demurgos","email":"demurgos@demurgos.net"},"dist":{"integrity":"sha512-6VRjVsA4Bce6AMFaYaqHgIsj1ZJqf+vOum+Bs7ejp4V4jfA6widxTiWFqVcqjk3pxC56rAXBPtrwxoioSNaUFw==","shasum":"4841890614fe66e93089a1579a61eed83f017267","tarball":"https://registry.npmjs.org/incident/-/incident-3.1.1-build.117.tgz","fileCount":17,"unpackedSize":98504,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBVkWi9g/9CwD4Vm5/MHuHXA7/HPrDmZYPTCGx8hrygUAiB2xIx58SSUmvLbyeZo92KzR5+O1OB0v+NYNudzgiV8tQ=="}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/incident_3.1.1-build.117_1521746458677_0.9549185360064483"},"_hasShrinkwrap":false},"3.1.1-build.123":{"name":"incident","version":"3.1.1-build.123","description":"Errors with superpowers","private":false,"main":"index","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/demurgos/incident.git"},"nyc":{"include":["build/test/lib/**/*.js"],"reporter":["text","html"]},"keywords":["error"],"pre-commit":{"run":["test"]},"author":{"name":"Charles Samborski","email":"demurgos@demurgos.net","url":"https://demurgos.net"},"license":"MIT","dependencies":{"@types/object-inspect":"^1.4.0","object-inspect":"^1.5.0"},"devDependencies":{"@types/chai":"^4.1.2","@types/mocha":"^2.2.48","chai":"^4.1.2","codecov":"^3.0.0","gulp":"^4.0.0","gulp-cli":"^2.0.1","minimist":"^1.2.0","pre-commit":"^1.2.2","ts-node":"^4.1.0","turbo-gulp":"^0.17.0","typescript":"^2.7.1"},"gitHead":"b8e8671ce03197c642bcfe62c35bcb879b519997","readme":"# Incident\n\n[![npm](https://img.shields.io/npm/v/incident.svg?maxAge=2592000)](https://www.npmjs.com/package/incident)\n[![GitHub repository](https://img.shields.io/badge/Github-demurgos%2Fincident-blue.svg)](https://github.com/demurgos/incident)\n[![Build status](https://img.shields.io/travis/demurgos/incident/master.svg?maxAge=2592000)](https://travis-ci.org/demurgos/incident)\n[![Codecov](https://codecov.io/gh/demurgos/incident/branch/master/graph/badge.svg)](https://codecov.io/gh/demurgos/incident)\n[![Greenkeeper badge](https://badges.greenkeeper.io/demurgos/incident.svg)](https://greenkeeper.io/)\n\nErrors with superpowers.\n\n## Installation\n\n```shell\nnpm install --save incident\n```\n\n## Features\n\n- Node and browser support.\n- Supports `instanceof Error` tests.\n- Built-in error causality tracking.\n- **Compatible with Typescript discriminated unions**. If you type the name, you can then use it\n  as a discriminant property to resolve the type of the data and cause.\n  See the example  below.\n- Compatible with prototypal inheritance and ES6 class inheritance\n- Distributed with type definitions for Typescript\n- Lazy stack capture and support for lazy message formatter: never called if not needed\n- Minimal dependencies: has a single dependency on [object-inspect](https://github.com/substack/object-inspect)\n- Tiny: 3kB minized, 1kB gziped\n\n## Migration from version 2\n\nEnsure that each of you always provide a `name`. You should mainly look for `new Incident(message)` and\n`new Incident(cause, message)` which would be interpreted as `new Incident(name)` and `new Incident(cause, name)`\nin version 3.\nAlso note that the order of the generic parameters changed from `<Name, Data, Cause>` to `<Data, Name, Cause>`.\n\n## Why\n\nMy goal with this library was to simplify the automatic handling of errors and\nprovide better error messages. Javascript errors are not very helpful because extending\nthem and then extracting data is tedious because you need a declaration statement,\nmultiple assignations, and then match on the name that is usually the generic `\"Error\"`\nor rely on a brittle `instance of`.\n\nTo achieve automatic error handling, the information describing the error should\nbe easily accessible programmatically. That's why you can directly pass a data object\nto the `Incident` constructor. Being able to pass data on the fly means that you do not need a\ndeclaration statement for the error separate property assignations. A key identifying the error\nis the second requirement for automatic error handling, `Incident` simply uses the name.\nAs explained in the features, it allows to unambiguously identify the error (I'd recommend to\nalways use a name). Using a name (as a string enum variant) is also more reliable than using\n`instance of` (prototype chain lookup) to check for the type of custom errors. The two main\nadvantages are that it's easier to serialize / deserialize and is not affected by the module\nduplication of the Node module resolution algorithm.\n\nTo provide better error messages, especially for asynchronous operations, I made the cause\nof the error a first-class information. It allows to deal with deferred or wrapped errors\nmore pleasant: the stack trace at each step is preserved.\n\nThe library is already pretty verbose (I am waiting for generic defaults in TS 2.3) so\nI'd like to keep the usage simple. For example, I have experimented with a arrays of causes (when\nan error has multiple simultaneous causes).\nThe displayed messages were pretty good but it made the code to handle the errors automatically\npretty complex because the type for the cause was `Error | Error[] | undefined`.\nThis feature did not even make it to the version 1. If you need it, but your multiple reasons\nin the `data` object.\n\nFinally, performance is also a goal. That's why the library performs late / lazy stack capture\nand allows for message formatters that are called only when needed.\n\n## Usage\n\n### Exports\n\n```typescript\nfunction Incident; // The Incident constructor\ninterface StaticIncident; // Interface of the constructor\ninterface Incident; // Interface of the instance\n```\n\n### `Incident`\n\nAn `Incident` has the following interface:\n\n```typescript\ninterface Incident<\n  Data extends object,\n  Name extends string = string,\n  Cause extends (Error | undefined) = (Error | undefined)\n> extends Error {\n  name: Name;\n  message: string;\n  data: Data;\n  cause: Cause;\n  stack: string;\n  toString(): string;\n}\n```\n\n### Generic parameters\n\n- **Name**: The type of the name, use a literal string type to be able to switch\n  ont the name and benefit from Typescript's type discrimination.\n- **Data**: The interface of the data associated to this error. Must respect `typeof data === \"object\"`\n- **Cause**: The type of the error cause. Use `undefined` if there is no cause.\n\n### Attributes\n\n#### `name`\n\nA name uniquely identifying the error. Displayed at the top of the stack.\n\n#### `message`\n\nA debug message for developers describing the error. Displayed at the top of the stack.\nIf you provide `data` but no `message`, the message will be generate from the data using\n[object-inspect](https://github.com/substack/object-inspect) with default options.\n\n#### `data`\n\nA data object associated to the error. This should describe the error enough\nto handle it programmatically.\n\n#### `cause`\n\nA previous error that cause this error. This usually has more detail about\nwhat happened.\n\n#### `stack`\n\nThe error stack of the incident. Contains the standard stack frames, and the\nstack of the cause if there is any.\n\n### Constructor\n\n```typescript\nnew Incident<Data, Name, Cause>([cause,] name, [data,] [message]);\n```\n\nYou can pass almost any combination of parameters you want as long as it is in the\nright order (see table below for the details) and a name is specified. If you want\nto explicitly define the generic parameters, you don't have to define the generic\nparameter for a function parameter you do not use. Instanciating a new Incident\ninstance will perform a lazy capture of the current call stack (only resolved when\nreading `.stack` or throwing the error).\n\n- **cause**\n  - Type: `Cause`\n  - Type constraint: If you provide a `cause`, `Cause extends Error` else `Cause` is `undefined`.\n  - Default type: `undefined`\n  - Default value: `undefined`\n  - Description: A previous error that caused this Incident.\n\n- **name**\n  - Type: `Name`\n  - Type constraint: `Name extends string`\n  - Default type: `string`\n  - **Required**\n  - Description: A name allowing to discriminate the error data and cause.\n\n- **data**\n  - Type: `Data`\n  - Type constraint: `Data extends object`\n  - Default type: `object`\n  - Default value: `{}`\n  - Description: A data object completely describing the error.\n\n- **message**\n  - Type: `string | ((data?: typeof data) => string)`\n  - Default value: `\"\"`\n  - Description: A debug message for developers. If the message is a formatter function,\n    it will be lazily evaluated (only once) when:\n    - the `message` property is accessed\n    - the `stack` property is accessed\n    - the error is thrown\n\n\n`new` operator signatures table\n\n|cause|name |data |message| Comment                                                  |\n|:---:|:---:|:---:|:-----:|:---------------------------------------------------------|\n|     |  ✔  |     |       |`new<Name>(...): Incident<Name, object, undefined>`       |\n|     |  ✔  |     |   ✔   |`new<Name>(...): Incident<Name, object, undefined>`       |\n|     |  ✔  |  ✔  |       |`new<Data, Name>(...): Incident<Name, Data, undefined>`   |\n|     |  ✔  |  ✔  |   ✔   |`new<Data, Name>(...): Incident<Name, Data, undefined>`   |\n|  ✔  |  ✔  |     |       |`new<Name, Cause>(...): Incident<Name, object, Cause>`    |\n|  ✔  |  ✔  |     |   ✔   |`new<Name, Cause>(...): Incident<Name, object, Cause>`    |\n|  ✔  |  ✔  |  ✔  |       |`new<Data, Name, Cause>(...): Incident<Name, Data, Cause>`|\n|  ✔  |  ✔  |  ✔  |   ✔   |`new<Data, Name, Cause>(...): Incident<Name, Data, Cause>`|\n\n### Call\n\nYou can call `Incident` as a simple function. It has the same signature as\nthe `new` operator but **does not capture the stack**. You may want to use\nit for higher order errors, but I recommend to capture the stack for root causes.\n\nThe simple call also supports the additional signature `(cause: Error)`.\nThis will perform a conversion from any error to an instance of the currently called\nIncident. You can use it normalize simple errors to Incident or mitigate module\nduplication if you rely on `instanceof`. The resulting incident will have the\nsame name, message, stack and data. If the input error was an Incident with\na lazy message or stack, it will remain non-evaluated.\nIf the argument is already an instance of the current `Incident`, a copy will be\ncreated. If you added extra properties, they will be lost.\n\n|cause|name |data |message| Comment                                                  |\n|:---:|:---:|:---:|:-----:|:---------------------------------------------------------|\n|  ✔  |     |     |       |**Converts to an instance of this `Incident` constructor**|\n|     |  ✔  |     |       |`<Name>(...): Incident<Name, object, undefined>`          |\n|     |  ✔  |     |   ✔   |`<Name>(...): Incident<Name, object, undefined>`          |\n|     |  ✔  |  ✔  |       |`<Data, Name>(...): Incident<Name, Data, undefined>`      |\n|     |  ✔  |  ✔  |   ✔   |`<Data, Name>(...): Incident<Name, Data, undefined>`      |\n|  ✔  |  ✔  |     |       |`<Name, Cause>(...): Incident<Name, object, Cause>`       |\n|  ✔  |  ✔  |     |   ✔   |`<Name, Cause>(...): Incident<Name, object, Cause>`       |\n|  ✔  |  ✔  |  ✔  |       |`<Data, Name, Cause>(...): Incident<Name, Data, Cause>`   |\n|  ✔  |  ✔  |  ✔  |   ✔   |`<Data, Name, Cause>(...): Incident<Name, Data, Cause>`   |\n\n## Discriminated union\n\n```typescript\n// Example of type resolution on a discriminated type\nimport Incident from \"incident\";\n\n// Associate the name \"SyntaxError\" to {index: number}\ntype SyntaxError = Incident<\"SyntaxError\", {index: number}, undefined>;\n// Associate the name \"TypeError\" to {typeName: string}\ntype TypeError = Incident<\"TypeError\", {typeName: string}, undefined>;\n// Created a discriminated type\ntype BaseError = SyntaxError | TypeError;\n\n// Example usage accepting the discriminated type\nfunction printError(error: BaseError): void {\n  // Switch on the discriminant\n  switch (error.name) {\n    case \"SyntaxError\":\n      // No need to cast: successfully resolved to SyntaxError\n      const index: number = error.data.index;\n      console.log(`Received a syntax error with index: ${index}`);\n      break;\n    case \"TypeError\":\n      // Successfully resolved to TypeError\n      const typename: string = error.data.typeName;\n      console.log(`Received a type error with typename: ${typename}`);\n      break;\n  }\n}\n```\n\n## License\n\n[MIT License](./LICENSE.md)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/demurgos/incident/issues"},"homepage":"https://github.com/demurgos/incident#readme","_id":"incident@3.1.1-build.123","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"demurgos","email":"demurgos@demurgos.net"},"dist":{"integrity":"sha512-4XioB8xsT+pAHjElixccyqGTpEqrDSFbRVDVHwGaSfYvRP65bQldqDLs84/u1AHzQgH5Gxbi4e6ceCI0NvDNeg==","shasum":"1c8d0c22cbd09768e0f1a97abaa6a3dabad1589a","tarball":"https://registry.npmjs.org/incident/-/incident-3.1.1-build.123.tgz","fileCount":17,"unpackedSize":96530,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa3fOrCRA9TVsSAnZWagAAgQgP/0rvQSv91G4X2sRgdXvW\nLXni2n94gGOIqk8J1g7iHUNoby30c7ZeOagLKQhvgKVs77S6+llzZX8yhwks\nptaUcMYqxwR5ZbbWSDH9kuVPu4n318eEWp907CgNRJdk+tL30bFyveWIrz4v\nvPFHxEph3pj0pQK36wDu0VZ5Gd2LXh9GuEKGsvR5lVTvU/FeVkB8f9Vvcm/P\nx/xPfppIkCyTvdZA7UoxF9DqGycemPe0eiZBy4OMWnxdR0lndsJaPbo8X3dr\nEIwlj08coP8/L2wVVW1FVCtUm5nJaxaF2JbvGA1XczSM5bqql/5sO9X7pa7j\nRurgLcfkwWSRVFV0lHIBLDu4aSp2maw85jMF2gVuDbrZXXcPZE33GVQN0Jtu\n9YKod9DLiNq2PGqVI0GN3kpAnmSDPal4fdOCtFW6R/JtsXCsiEHtoa/Dq5Tk\nK5q8alNlpyFIWQKgzNOPInM55Rol0GW6uWeNCO75tIphQZXhEvA2IsRhnzUO\nUwI4k+6AL1ZLdQTdwIwSMsG+GCyRFscvJcfEeg0domuHs12ZiJfILE2z4Kt7\nZHohuvuI/LwrBYtcwYY1nCebkOqrFlnhh0fUMaaqOIuzeIyh6KZ8jVwbvILj\nHkAr/B827xBK3/OPRZ6nip0cu3Nv5WGdJ/clm/mOUyaFPb/vUtqMQaWZW5be\nCn/4\r\n=/jsL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCAu1o1MAlewsS/QEPBPwbsRZk86GYTj/9d1khQHnZqEAIhAJTsm0dKQkIvnHj0E25bloVkT3RlN/qF4VPM3CoJ7O25"}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/incident_3.1.1-build.123_1524495274895_0.05874456299034647"},"_hasShrinkwrap":false},"3.1.1-build.132":{"name":"incident","version":"3.1.1-build.132","description":"Errors with superpowers","private":false,"main":"index","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/demurgos/incident.git"},"nyc":{"include":["build/test/lib/**/*.js"],"reporter":["text","html"]},"keywords":["error"],"pre-commit":{"run":["test"]},"author":{"name":"Charles Samborski","email":"demurgos@demurgos.net","url":"https://demurgos.net"},"license":"MIT","dependencies":{"@types/object-inspect":"^1.4.0","object-inspect":"^1.5.0"},"devDependencies":{"@types/chai":"^4.1.2","@types/mocha":"^5.2.1","chai":"^4.1.2","codecov":"^3.0.0","gulp":"^4.0.0","gulp-cli":"^2.0.1","minimist":"^1.2.0","pre-commit":"^1.2.2","ts-node":"^4.1.0","turbo-gulp":"^0.16.2","typescript":"^2.7.1"},"gitHead":"24ea64334fc5aecda2ed147ab2a3256692388243","readme":"# Incident\n\n[![npm](https://img.shields.io/npm/v/incident.svg?maxAge=2592000)](https://www.npmjs.com/package/incident)\n[![GitHub repository](https://img.shields.io/badge/Github-demurgos%2Fincident-blue.svg)](https://github.com/demurgos/incident)\n[![Build status](https://img.shields.io/travis/demurgos/incident/master.svg?maxAge=2592000)](https://travis-ci.org/demurgos/incident)\n[![Codecov](https://codecov.io/gh/demurgos/incident/branch/master/graph/badge.svg)](https://codecov.io/gh/demurgos/incident)\n[![Greenkeeper badge](https://badges.greenkeeper.io/demurgos/incident.svg)](https://greenkeeper.io/)\n\nErrors with superpowers.\n\n## Installation\n\n```shell\nnpm install --save incident\n```\n\n## Features\n\n- Node and browser support.\n- Supports `instanceof Error` tests.\n- Built-in error causality tracking.\n- **Compatible with Typescript discriminated unions**. If you type the name, you can then use it\n  as a discriminant property to resolve the type of the data and cause.\n  See the example  below.\n- Compatible with prototypal inheritance and ES6 class inheritance\n- Distributed with type definitions for Typescript\n- Lazy stack capture and support for lazy message formatter: never called if not needed\n- Minimal dependencies: has a single dependency on [object-inspect](https://github.com/substack/object-inspect)\n- Tiny: 3kB minized, 1kB gziped\n\n## Migration from version 2\n\nEnsure that each of you always provide a `name`. You should mainly look for `new Incident(message)` and\n`new Incident(cause, message)` which would be interpreted as `new Incident(name)` and `new Incident(cause, name)`\nin version 3.\nAlso note that the order of the generic parameters changed from `<Name, Data, Cause>` to `<Data, Name, Cause>`.\n\n## Why\n\nMy goal with this library was to simplify the automatic handling of errors and\nprovide better error messages. Javascript errors are not very helpful because extending\nthem and then extracting data is tedious because you need a declaration statement,\nmultiple assignations, and then match on the name that is usually the generic `\"Error\"`\nor rely on a brittle `instance of`.\n\nTo achieve automatic error handling, the information describing the error should\nbe easily accessible programmatically. That's why you can directly pass a data object\nto the `Incident` constructor. Being able to pass data on the fly means that you do not need a\ndeclaration statement for the error separate property assignations. A key identifying the error\nis the second requirement for automatic error handling, `Incident` simply uses the name.\nAs explained in the features, it allows to unambiguously identify the error (I'd recommend to\nalways use a name). Using a name (as a string enum variant) is also more reliable than using\n`instance of` (prototype chain lookup) to check for the type of custom errors. The two main\nadvantages are that it's easier to serialize / deserialize and is not affected by the module\nduplication of the Node module resolution algorithm.\n\nTo provide better error messages, especially for asynchronous operations, I made the cause\nof the error a first-class information. It allows to deal with deferred or wrapped errors\nmore pleasant: the stack trace at each step is preserved.\n\nThe library is already pretty verbose (I am waiting for generic defaults in TS 2.3) so\nI'd like to keep the usage simple. For example, I have experimented with a arrays of causes (when\nan error has multiple simultaneous causes).\nThe displayed messages were pretty good but it made the code to handle the errors automatically\npretty complex because the type for the cause was `Error | Error[] | undefined`.\nThis feature did not even make it to the version 1. If you need it, but your multiple reasons\nin the `data` object.\n\nFinally, performance is also a goal. That's why the library performs late / lazy stack capture\nand allows for message formatters that are called only when needed.\n\n## Usage\n\n### Exports\n\n```typescript\nfunction Incident; // The Incident constructor\ninterface StaticIncident; // Interface of the constructor\ninterface Incident; // Interface of the instance\n```\n\n### `Incident`\n\nAn `Incident` has the following interface:\n\n```typescript\ninterface Incident<\n  Data extends object,\n  Name extends string = string,\n  Cause extends (Error | undefined) = (Error | undefined)\n> extends Error {\n  name: Name;\n  message: string;\n  data: Data;\n  cause: Cause;\n  stack: string;\n  toString(): string;\n}\n```\n\n### Generic parameters\n\n- **Name**: The type of the name, use a literal string type to be able to switch\n  ont the name and benefit from Typescript's type discrimination.\n- **Data**: The interface of the data associated to this error. Must respect `typeof data === \"object\"`\n- **Cause**: The type of the error cause. Use `undefined` if there is no cause.\n\n### Attributes\n\n#### `name`\n\nA name uniquely identifying the error. Displayed at the top of the stack.\n\n#### `message`\n\nA debug message for developers describing the error. Displayed at the top of the stack.\nIf you provide `data` but no `message`, the message will be generate from the data using\n[object-inspect](https://github.com/substack/object-inspect) with default options.\n\n#### `data`\n\nA data object associated to the error. This should describe the error enough\nto handle it programmatically.\n\n#### `cause`\n\nA previous error that cause this error. This usually has more detail about\nwhat happened.\n\n#### `stack`\n\nThe error stack of the incident. Contains the standard stack frames, and the\nstack of the cause if there is any.\n\n### Constructor\n\n```typescript\nnew Incident<Data, Name, Cause>([cause,] name, [data,] [message]);\n```\n\nYou can pass almost any combination of parameters you want as long as it is in the\nright order (see table below for the details) and a name is specified. If you want\nto explicitly define the generic parameters, you don't have to define the generic\nparameter for a function parameter you do not use. Instanciating a new Incident\ninstance will perform a lazy capture of the current call stack (only resolved when\nreading `.stack` or throwing the error).\n\n- **cause**\n  - Type: `Cause`\n  - Type constraint: If you provide a `cause`, `Cause extends Error` else `Cause` is `undefined`.\n  - Default type: `undefined`\n  - Default value: `undefined`\n  - Description: A previous error that caused this Incident.\n\n- **name**\n  - Type: `Name`\n  - Type constraint: `Name extends string`\n  - Default type: `string`\n  - **Required**\n  - Description: A name allowing to discriminate the error data and cause.\n\n- **data**\n  - Type: `Data`\n  - Type constraint: `Data extends object`\n  - Default type: `object`\n  - Default value: `{}`\n  - Description: A data object completely describing the error.\n\n- **message**\n  - Type: `string | ((data?: typeof data) => string)`\n  - Default value: `\"\"`\n  - Description: A debug message for developers. If the message is a formatter function,\n    it will be lazily evaluated (only once) when:\n    - the `message` property is accessed\n    - the `stack` property is accessed\n    - the error is thrown\n\n\n`new` operator signatures table\n\n|cause|name |data |message| Comment                                                  |\n|:---:|:---:|:---:|:-----:|:---------------------------------------------------------|\n|     |  ✔  |     |       |`new<Name>(...): Incident<Name, object, undefined>`       |\n|     |  ✔  |     |   ✔   |`new<Name>(...): Incident<Name, object, undefined>`       |\n|     |  ✔  |  ✔  |       |`new<Data, Name>(...): Incident<Name, Data, undefined>`   |\n|     |  ✔  |  ✔  |   ✔   |`new<Data, Name>(...): Incident<Name, Data, undefined>`   |\n|  ✔  |  ✔  |     |       |`new<Name, Cause>(...): Incident<Name, object, Cause>`    |\n|  ✔  |  ✔  |     |   ✔   |`new<Name, Cause>(...): Incident<Name, object, Cause>`    |\n|  ✔  |  ✔  |  ✔  |       |`new<Data, Name, Cause>(...): Incident<Name, Data, Cause>`|\n|  ✔  |  ✔  |  ✔  |   ✔   |`new<Data, Name, Cause>(...): Incident<Name, Data, Cause>`|\n\n### Call\n\nYou can call `Incident` as a simple function. It has the same signature as\nthe `new` operator but **does not capture the stack**. You may want to use\nit for higher order errors, but I recommend to capture the stack for root causes.\n\nThe simple call also supports the additional signature `(cause: Error)`.\nThis will perform a conversion from any error to an instance of the currently called\nIncident. You can use it normalize simple errors to Incident or mitigate module\nduplication if you rely on `instanceof`. The resulting incident will have the\nsame name, message, stack and data. If the input error was an Incident with\na lazy message or stack, it will remain non-evaluated.\nIf the argument is already an instance of the current `Incident`, a copy will be\ncreated. If you added extra properties, they will be lost.\n\n|cause|name |data |message| Comment                                                  |\n|:---:|:---:|:---:|:-----:|:---------------------------------------------------------|\n|  ✔  |     |     |       |**Converts to an instance of this `Incident` constructor**|\n|     |  ✔  |     |       |`<Name>(...): Incident<Name, object, undefined>`          |\n|     |  ✔  |     |   ✔   |`<Name>(...): Incident<Name, object, undefined>`          |\n|     |  ✔  |  ✔  |       |`<Data, Name>(...): Incident<Name, Data, undefined>`      |\n|     |  ✔  |  ✔  |   ✔   |`<Data, Name>(...): Incident<Name, Data, undefined>`      |\n|  ✔  |  ✔  |     |       |`<Name, Cause>(...): Incident<Name, object, Cause>`       |\n|  ✔  |  ✔  |     |   ✔   |`<Name, Cause>(...): Incident<Name, object, Cause>`       |\n|  ✔  |  ✔  |  ✔  |       |`<Data, Name, Cause>(...): Incident<Name, Data, Cause>`   |\n|  ✔  |  ✔  |  ✔  |   ✔   |`<Data, Name, Cause>(...): Incident<Name, Data, Cause>`   |\n\n## Discriminated union\n\n```typescript\n// Example of type resolution on a discriminated type\nimport Incident from \"incident\";\n\n// Associate the name \"SyntaxError\" to {index: number}\ntype SyntaxError = Incident<\"SyntaxError\", {index: number}, undefined>;\n// Associate the name \"TypeError\" to {typeName: string}\ntype TypeError = Incident<\"TypeError\", {typeName: string}, undefined>;\n// Created a discriminated type\ntype BaseError = SyntaxError | TypeError;\n\n// Example usage accepting the discriminated type\nfunction printError(error: BaseError): void {\n  // Switch on the discriminant\n  switch (error.name) {\n    case \"SyntaxError\":\n      // No need to cast: successfully resolved to SyntaxError\n      const index: number = error.data.index;\n      console.log(`Received a syntax error with index: ${index}`);\n      break;\n    case \"TypeError\":\n      // Successfully resolved to TypeError\n      const typename: string = error.data.typeName;\n      console.log(`Received a type error with typename: ${typename}`);\n      break;\n  }\n}\n```\n\n## License\n\n[MIT License](./LICENSE.md)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/demurgos/incident/issues"},"homepage":"https://github.com/demurgos/incident#readme","_id":"incident@3.1.1-build.132","_npmVersion":"6.1.0","_nodeVersion":"10.3.0","_npmUser":{"name":"demurgos","email":"demurgos@demurgos.net"},"dist":{"integrity":"sha512-weNQ6COaI8jpHmvwey/Hb6Gk48Yy+7/XWZDxIa09adD+KxGvi2zxF6Y6IDbxvGVipcZ58zi36fAuMnVJUQFhJw==","shasum":"d8b97882ff8d123e5dbe94f189971e5889347868","tarball":"https://registry.npmjs.org/incident/-/incident-3.1.1-build.132.tgz","fileCount":17,"unpackedSize":98504,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbEnH4CRA9TVsSAnZWagAAsI4QAJGfwucAB85e1mpei1kc\ntPuW18l5/8Cm6YnXhad1NuEay+1ggghI/GJLLFdDkriltfntQT4hUCvF+reB\nLTBBR4ByEhB3/iG6MOMahU1bFnYCObtpJCSZkoE28/qICas8uH9bAO3F61/K\n5Uiq6ozmiWmNbHWMSXS2p3O54xzb5+ZHOlXl4U/ECVt54YDpoHreN8VXcwby\neLHT73QhHLjj4cAO0LKQXeESI6pLi1Pd+IfWsMAh7JPu0zNIS7q5fRt7RoNr\ntqT1sHJhFIMOiNDqCUnG56ZNzigG571lkQnKvBxMGaJIHckkK7NoGnj1OBgK\nzyCBuvm324jwKrfJUcx0pNrmYs7sC7kRg6xzdo+QOUSXuqVAJxSEkUi41/5F\njLWPR5Ok8rIK1p+yMs2IKVDVfCBcum31wgw4WtlAsSo7X85bHFiE+76NrrGT\nu00vWa05zas/OYnfPCTNjQVHvTSQUW4wJqfPQiD5uNFWbXzAC0wLEdCXxPpB\nRWvaFDfez8KhwiLxGC1osLZuz2n41mfkTXORX1fr4a3S0w61q98uU2JGnD2L\nW9d6knhjCYGxL8jB1zl8umDjuX2vYMet26XQQXKI+ZuEQH4ztA0ew4d+ey2n\nNqfW2nexnR+u8JIzZ7FEpSkQsBa0S6PKiix65YInjXypTYmEFkqxPnsYG+rr\nYa2/\r\n=FN35\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBTro/oFzdtBvKkf+3lq8Wcteucm3I1V517Skc3SaTgnAiBqHxQvk4Hrd28ipDlHsVXyl/79KSsTzPjU2bAlGaxzeg=="}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/incident_3.1.1-build.132_1527935480168_0.40067006458815735"},"_hasShrinkwrap":false},"3.2.0":{"name":"incident","version":"3.2.0","description":"Errors with superpowers","private":false,"main":"index","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/demurgos/incident.git"},"keywords":["error"],"pre-commit":{"run":["pre-commit"]},"author":{"name":"Charles Samborski","email":"demurgos@demurgos.net","url":"https://demurgos.net"},"license":"MIT","dependencies":{"@types/object-inspect":"^1.4.0","object-inspect":"^1.6.0"},"devDependencies":{"@types/chai":"^4.1.7","@types/gulp":"^4.0.5","@types/minimist":"^1.2.0","@types/mocha":"^5.2.5","chai":"^4.2.0","codecov":"^3.1.0","gulp":"^4.0.0","gulp-cli":"^2.0.1","minimist":"^1.2.0","pre-commit":"^1.2.2","ts-node":"^7.0.1","turbo-gulp":"^0.18.0","typescript":"^3.2.2"},"c88":{"match":["build/test/lib/*.{js,mjs}","build/test/lib/**/*.{js,mjs}"]},"gitHead":"c6e8531d722b5c579f2f8fc83b88052d4569ee25","bugs":{"url":"https://github.com/demurgos/incident/issues"},"homepage":"https://github.com/demurgos/incident#readme","_id":"incident@3.2.0","_npmVersion":"6.4.1","_nodeVersion":"11.4.0","_npmUser":{"name":"demurgos","email":"demurgos@demurgos.net"},"dist":{"integrity":"sha512-Hok2kKEfZorHNeLePZxe03JCI0KxaN4XwrbwHWMSgZgyuNP/Pu/vqX1bwtm7FgwdqgXvEwAmDS5VCAkXnH3DXg==","shasum":"448f14ab46d52512240efc7466a5b0a0f3bd89ab","tarball":"https://registry.npmjs.org/incident/-/incident-3.2.0.tgz","fileCount":16,"unpackedSize":97492,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDlgYCRA9TVsSAnZWagAAw/MP/1dBl33KACT9T6GyNPJx\nH73P/DiL/hAy4J2l8O2G5EYwWhpphcOZFHc7FfGXHB9WWQtsXRU6hj/p63gS\ns0mXCee6RKnOtUUGuRiaRgVDSn+ryiCBWd1K0+hCHT7T7H2OUtCzLqSLZSi0\n9W22/IFQlULUVrLV9Wyboebt3FrAnPVTRpncCuj5Wh9BJy/O5pIf5AbATEL/\nsCWynq13qzg+W7O3CJBtHpE90mrGyMdeWubJdPq+xfpOP2JNZIMG3mCg8jjs\nUxej1q/T8MLs8VjlEo26QQLOXbboNZ+4EDjGnX5BC2EKEv3/72Imp+iWY7FS\n0C89X2g5AkYQ9+u7xnpoRyLyUThWy0Ozrq3DfOwV4B7Dcv/Xkvfp6/PzqZky\nVi6cWxhGx9g24xBWXu50qRjoOPgmP9zdtBKUzrEK+UzHMKUiISUVA3sAdOBy\nMcawKr1KyhAaGitMv1nH9tYdOhBUn2lVyNYbhVi8UHTVhgS48nyLFhI1Ip5H\nVGMLOwkabyqoNw9DYW2PwMiOwLM4QvtRwM0seBG/GCVm+enEggQfkLs1Emvg\nB1TqGEXTBkrl2j2zNPMD1ChKB1P7OmR2yPKtjum8pQrCMWaGP5aX0HIJyU9G\n4m1WRz4FGQGs68e2Z3rGA3vqNQO0Hs5JyKLY6d+JngjJo+SRTQzpzKRaip+D\np2mN\r\n=mS0T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHE1u5Lgzd6nRs51xc+1t2Y/Fly5WnbnTnTOYubOB8ndAiAzo80dR6G8rWALqGK57sRd0jUXZEl5WWq4UIw/KodBOw=="}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/incident_3.2.0_1544443928011_0.9620668228276004"},"_hasShrinkwrap":false},"3.2.1":{"name":"incident","version":"3.2.1","description":"Errors with superpowers","private":false,"main":"index","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/demurgos/incident.git"},"keywords":["error"],"pre-commit":{"run":["lint"]},"author":{"name":"Charles Samborski","email":"demurgos@demurgos.net","url":"https://demurgos.net"},"license":"MIT","dependencies":{"@types/object-inspect":"^1.4.0","object-inspect":"^1.6.0"},"devDependencies":{"@types/chai":"^4.1.7","@types/gulp":"^4.0.6","@types/minimist":"^1.2.0","@types/mocha":"^5.2.6","chai":"^4.2.0","codecov":"^3.4.0","gulp":"^4.0.2","gulp-cli":"^2.2.0","minimist":"^1.2.0","pre-commit":"^1.2.2","ts-node":"^8.1.0","turbo-gulp":"^0.20.1","typescript":"^3.4.5"},"c88":{"match":["build/test/lib/*.{js,mjs}","build/test/lib/**/*.{js,mjs}"]},"gitHead":"44dff3abfc8612760fd2dc4434d4085f9f07e5e9","bugs":{"url":"https://github.com/demurgos/incident/issues"},"homepage":"https://github.com/demurgos/incident#readme","_id":"incident@3.2.1","_nodeVersion":"13.12.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Mejx4QijYGSBAaR8NobH5dhFC7h5q1bIClsAtdoTEl/YzqSYVE/5WgovlYUHqwdBTLHkptQ5bv9nJNsJCJDeXg==","shasum":"731dbe73cf6a5cdb89adf8fa0825e2ff076b205d","tarball":"https://registry.npmjs.org/incident/-/incident-3.2.1.tgz","fileCount":16,"unpackedSize":98656,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejiobCRA9TVsSAnZWagAARVAP/0AtNv+8nz0NVdQm5tGV\nE1CVUI/w3y0ybGynELdCZRa3dx9bc2ZMvKj+6mRHo/zw1XlJz5uagNFPD7Z7\noWUuqFm/thrlBymmRtq4VPVIh8RPibqeMiUBqWaDozpIoX4wbeJdYNfCB0yH\nf8fANfd9+Tj6zIBFfbHKaR6CEXG/aqSYE6U8e/NkdKpg3on50cUrzFR55KA0\nCzFwtGoZNOiSnQNb0qrM0HhaosIDlbGjzJvZO/RWrM51rDsXnDJ24+Ts+Rw3\nyiPijkwLOiouaVzfHp+YGSRiynqxpuizWgNoQ22kV6XlGZTTry5xg4XgHNA1\nlEDCCBxgLtadEm4NInrTUPmlqHud1LsrD24bxdGFtU7Gl22RDH3+9R2H2cxL\nzbghRQunRpfd1MJBctRx4uLMHFJ8lTV+NLZCNhl7pgR9gpoqZ9gX9gibLQ8z\niZaTQDfKOUAhnrNU6SLpZV4yeWwrOa0cIKP8VAdROCw+/cRPs3Rcwxxu270L\nFvjiU3udBdLB03TS1Ds1cCQRDTIaJdio1ybCHjIbjfHQ9UARM2Ezkr6RrtqT\nNdSf+taUGeRUPTlh89rKWMVDc/0x92OonMjCbokNfJZjlBWaSaUxUf91jt5r\nYjELMeDbYcDk5BE0BD8RVDdOfkyEVxqPE5dm7lBkCLBMMMLOVZyZNFQHQlRo\nHGFH\r\n=OoZX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEtYd3wcLqILVzK3zp9Pa7D83JGWktzIeBc+EPqRFcv6AiEAqstFiMnau736yee51TfDif2M7feAMEtVGOouFug4Bdw="}]},"maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"_npmUser":{"name":"demurgos","email":"demurgos@demurgos.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/incident_3.2.1_1586375195338_0.1554749566159943"},"_hasShrinkwrap":false}},"readme":"# Incident\n\n[![npm](https://img.shields.io/npm/v/incident.svg?maxAge=2592000)](https://www.npmjs.com/package/incident)\n[![GitHub repository](https://img.shields.io/badge/Github-demurgos%2Fincident-blue.svg)](https://github.com/demurgos/incident)\n[![Build status](https://img.shields.io/travis/demurgos/incident/master.svg?maxAge=2592000)](https://travis-ci.org/demurgos/incident)\n[![Codecov](https://codecov.io/gh/demurgos/incident/branch/master/graph/badge.svg)](https://codecov.io/gh/demurgos/incident)\n\nErrors with superpowers.\n\n## Installation\n\n```shell\nnpm install --save incident\n```\n\n## Features\n\n- Node and browser support.\n- Supports `instanceof Error` tests.\n- Built-in error causality tracking.\n- **Compatible with Typescript discriminated unions**. If you type the name, you can then use it\n  as a discriminant property to resolve the type of the data and cause.\n  See the example  below.\n- Compatible with prototypal inheritance and ES6 class inheritance\n- Distributed with type definitions for Typescript\n- Lazy stack capture and support for lazy message formatter: never called if not needed\n- Minimal dependencies: has a single dependency on [object-inspect](https://github.com/substack/object-inspect)\n- Tiny: 3kB minized, 1kB gziped\n\n## Migration from version 2\n\nEnsure that each of you always provide a `name`. You should mainly look for `new Incident(message)` and\n`new Incident(cause, message)` which would be interpreted as `new Incident(name)` and `new Incident(cause, name)`\nin version 3.\nAlso note that the order of the generic parameters changed from `<Name, Data, Cause>` to `<Data, Name, Cause>`.\n\n## Why\n\nMy goal with this library was to simplify the automatic handling of errors and\nprovide better error messages. Javascript errors are not very helpful because extending\nthem and then extracting data is tedious because you need a declaration statement,\nmultiple assignations, and then match on the name that is usually the generic `\"Error\"`\nor rely on a brittle `instance of`.\n\nTo achieve automatic error handling, the information describing the error should\nbe easily accessible programmatically. That's why you can directly pass a data object\nto the `Incident` constructor. Being able to pass data on the fly means that you do not need a\ndeclaration statement for the error separate property assignations. A key identifying the error\nis the second requirement for automatic error handling, `Incident` simply uses the name.\nAs explained in the features, it allows to unambiguously identify the error (I'd recommend to\nalways use a name). Using a name (as a string enum variant) is also more reliable than using\n`instance of` (prototype chain lookup) to check for the type of custom errors. The two main\nadvantages are that it's easier to serialize / deserialize and is not affected by the module\nduplication of the Node module resolution algorithm.\n\nTo provide better error messages, especially for asynchronous operations, I made the cause\nof the error a first-class information. It allows to deal with deferred or wrapped errors\nmore pleasant: the stack trace at each step is preserved.\n\nThe library is already pretty verbose (I am waiting for generic defaults in TS 2.3) so\nI'd like to keep the usage simple. For example, I have experimented with a arrays of causes (when\nan error has multiple simultaneous causes).\nThe displayed messages were pretty good but it made the code to handle the errors automatically\npretty complex because the type for the cause was `Error | Error[] | undefined`.\nThis feature did not even make it to the version 1. If you need it, but your multiple reasons\nin the `data` object.\n\nFinally, performance is also a goal. That's why the library performs late / lazy stack capture\nand allows for message formatters that are called only when needed.\n\n## Usage\n\n### Exports\n\n```typescript\nfunction Incident; // The Incident constructor\ninterface StaticIncident; // Interface of the constructor\ninterface Incident; // Interface of the instance\n```\n\n### `Incident`\n\nAn `Incident` has the following interface:\n\n```typescript\ninterface Incident<\n  Data extends object,\n  Name extends string = string,\n  Cause extends (Error | undefined) = (Error | undefined)\n> extends Error {\n  name: Name;\n  message: string;\n  data: Data;\n  cause: Cause;\n  stack: string;\n  toString(): string;\n}\n```\n\n### Generic parameters\n\n- **Name**: The type of the name, use a literal string type to be able to switch\n  ont the name and benefit from Typescript's type discrimination.\n- **Data**: The interface of the data associated to this error. Must respect `typeof data === \"object\"`\n- **Cause**: The type of the error cause. Use `undefined` if there is no cause.\n\n### Attributes\n\n#### `name`\n\nA name uniquely identifying the error. Displayed at the top of the stack.\n\n#### `message`\n\nA debug message for developers describing the error. Displayed at the top of the stack.\nIf you provide `data` but no `message`, the message will be generate from the data using\n[object-inspect](https://github.com/substack/object-inspect) with default options.\n\n#### `data`\n\nA data object associated to the error. This should describe the error enough\nto handle it programmatically.\n\n#### `cause`\n\nA previous error that cause this error. This usually has more detail about\nwhat happened.\n\n#### `stack`\n\nThe error stack of the incident. Contains the standard stack frames, and the\nstack of the cause if there is any.\n\n### Constructor\n\n```typescript\nnew Incident<Data, Name, Cause>([cause,] name, [data,] [message]);\n```\n\nYou can pass almost any combination of parameters you want as long as it is in the\nright order (see table below for the details) and a name is specified. If you want\nto explicitly define the generic parameters, you don't have to define the generic\nparameter for a function parameter you do not use. Instanciating a new Incident\ninstance will perform a lazy capture of the current call stack (only resolved when\nreading `.stack` or throwing the error).\n\n- **cause**\n  - Type: `Cause`\n  - Type constraint: If you provide a `cause`, `Cause extends Error` else `Cause` is `undefined`.\n  - Default type: `undefined`\n  - Default value: `undefined`\n  - Description: A previous error that caused this Incident.\n\n- **name**\n  - Type: `Name`\n  - Type constraint: `Name extends string`\n  - Default type: `string`\n  - **Required**\n  - Description: A name allowing to discriminate the error data and cause.\n\n- **data**\n  - Type: `Data`\n  - Type constraint: `Data extends object`\n  - Default type: `object`\n  - Default value: `{}`\n  - Description: A data object completely describing the error.\n\n- **message**\n  - Type: `string | ((data?: typeof data) => string)`\n  - Default value: `\"\"`\n  - Description: A debug message for developers. If the message is a formatter function,\n    it will be lazily evaluated (only once) when:\n    - the `message` property is accessed\n    - the `stack` property is accessed\n    - the error is thrown\n\n\n`new` operator signatures table\n\n|cause|name |data |message| Comment                                                  |\n|:---:|:---:|:---:|:-----:|:---------------------------------------------------------|\n|     |  ✔  |     |       |`new<Name>(...): Incident<Name, object, undefined>`       |\n|     |  ✔  |     |   ✔   |`new<Name>(...): Incident<Name, object, undefined>`       |\n|     |  ✔  |  ✔  |       |`new<Data, Name>(...): Incident<Name, Data, undefined>`   |\n|     |  ✔  |  ✔  |   ✔   |`new<Data, Name>(...): Incident<Name, Data, undefined>`   |\n|  ✔  |  ✔  |     |       |`new<Name, Cause>(...): Incident<Name, object, Cause>`    |\n|  ✔  |  ✔  |     |   ✔   |`new<Name, Cause>(...): Incident<Name, object, Cause>`    |\n|  ✔  |  ✔  |  ✔  |       |`new<Data, Name, Cause>(...): Incident<Name, Data, Cause>`|\n|  ✔  |  ✔  |  ✔  |   ✔   |`new<Data, Name, Cause>(...): Incident<Name, Data, Cause>`|\n\n### Call\n\nYou can call `Incident` as a simple function. It has the same signature as\nthe `new` operator but **does not capture the stack**. You may want to use\nit for higher order errors, but I recommend to capture the stack for root causes.\n\nThe simple call also supports the additional signature `(cause: Error)`.\nThis will perform a conversion from any error to an instance of the currently called\nIncident. You can use it normalize simple errors to Incident or mitigate module\nduplication if you rely on `instanceof`. The resulting incident will have the\nsame name, message, stack and data. If the input error was an Incident with\na lazy message or stack, it will remain non-evaluated.\nIf the argument is already an instance of the current `Incident`, a copy will be\ncreated. If you added extra properties, they will be lost.\n\n|cause|name |data |message| Comment                                                  |\n|:---:|:---:|:---:|:-----:|:---------------------------------------------------------|\n|  ✔  |     |     |       |**Converts to an instance of this `Incident` constructor**|\n|     |  ✔  |     |       |`<Name>(...): Incident<Name, object, undefined>`          |\n|     |  ✔  |     |   ✔   |`<Name>(...): Incident<Name, object, undefined>`          |\n|     |  ✔  |  ✔  |       |`<Data, Name>(...): Incident<Name, Data, undefined>`      |\n|     |  ✔  |  ✔  |   ✔   |`<Data, Name>(...): Incident<Name, Data, undefined>`      |\n|  ✔  |  ✔  |     |       |`<Name, Cause>(...): Incident<Name, object, Cause>`       |\n|  ✔  |  ✔  |     |   ✔   |`<Name, Cause>(...): Incident<Name, object, Cause>`       |\n|  ✔  |  ✔  |  ✔  |       |`<Data, Name, Cause>(...): Incident<Name, Data, Cause>`   |\n|  ✔  |  ✔  |  ✔  |   ✔   |`<Data, Name, Cause>(...): Incident<Name, Data, Cause>`   |\n\n## Discriminated union\n\n```typescript\n// Example of type resolution on a discriminated type\nimport Incident from \"incident\";\n\n// Associate the name \"SyntaxError\" to {index: number}\ntype SyntaxError = Incident<\"SyntaxError\", {index: number}, undefined>;\n// Associate the name \"TypeError\" to {typeName: string}\ntype TypeError = Incident<\"TypeError\", {typeName: string}, undefined>;\n// Created a discriminated type\ntype BaseError = SyntaxError | TypeError;\n\n// Example usage accepting the discriminated type\nfunction printError(error: BaseError): void {\n  // Switch on the discriminant\n  switch (error.name) {\n    case \"SyntaxError\":\n      // No need to cast: successfully resolved to SyntaxError\n      const index: number = error.data.index;\n      console.log(`Received a syntax error with index: ${index}`);\n      break;\n    case \"TypeError\":\n      // Successfully resolved to TypeError\n      const typename: string = error.data.typeName;\n      console.log(`Received a type error with typename: ${typename}`);\n      break;\n  }\n}\n```\n\n## License\n\n[MIT License](./LICENSE.md)\n","maintainers":[{"name":"demurgos","email":"csamborski@hotmail.fr"}],"time":{"modified":"2022-06-19T01:00:25.982Z","created":"2016-01-20T19:51:29.715Z","1.0.1":"2016-01-20T19:51:29.715Z","1.0.2":"2016-01-21T13:04:38.474Z","1.0.3":"2016-04-14T23:05:42.355Z","1.0.4":"2016-04-17T20:29:15.475Z","1.0.5":"2016-04-21T21:01:17.402Z","1.0.6":"2016-05-21T20:52:42.239Z","1.0.7":"2016-05-23T11:01:01.282Z","1.1.0":"2016-12-15T16:46:59.218Z","1.1.1":"2016-12-16T11:20:39.595Z","1.2.0":"2017-04-20T16:18:37.299Z","1.2.1":"2017-04-20T19:10:13.583Z","2.0.0":"2017-04-21T18:20:43.893Z","2.0.0-build.47":"2017-11-10T20:58:38.746Z","2.0.0-build.52":"2017-11-12T13:26:36.780Z","3.0.0":"2017-11-12T14:01:30.855Z","3.0.0-build.64":"2017-11-13T15:04:41.789Z","3.0.0-build.66":"2017-11-29T20:27:13.067Z","3.0.0-build.76":"2017-12-10T23:43:52.993Z","3.0.0-build.80":"2017-12-19T10:38:31.847Z","3.0.0-build.82":"2017-12-21T22:36:47.207Z","3.0.1-build.84":"2018-01-02T10:45:45.106Z","3.0.1":"2018-01-02T10:55:23.916Z","3.0.1-build.89":"2018-01-09T19:44:10.161Z","3.1.0":"2018-01-09T20:18:12.384Z","3.1.0-build.103":"2018-01-10T23:06:04.553Z","3.1.1-build.108":"2018-02-07T19:38:40.159Z","3.1.1":"2018-02-07T19:57:29.816Z","3.1.1-build.117":"2018-03-22T19:20:58.805Z","3.1.1-build.123":"2018-04-23T14:54:35.063Z","3.1.1-build.132":"2018-06-02T10:31:20.358Z","3.2.0":"2018-12-10T12:12:08.161Z","3.2.1":"2020-04-08T19:46:35.469Z"},"homepage":"https://github.com/demurgos/incident#readme","keywords":["error"],"repository":{"type":"git","url":"git+https://github.com/demurgos/incident.git"},"bugs":{"url":"https://github.com/demurgos/incident/issues"},"license":"MIT","readmeFilename":"README.md","users":{"demurgos":true},"author":{"name":"Charles Samborski","email":"demurgos@demurgos.net","url":"https://demurgos.net"}}