Merge pull request #28427 from woutervh-/create-nested-error-stacks

@types/nested-error-stacks Added typings for nested-error-stacks
This commit is contained in:
Armando Aguirre
2018-08-28 13:26:45 -07:00
committed by GitHub
4 changed files with 42 additions and 0 deletions

10
types/nested-error-stacks/index.d.ts vendored Normal file
View File

@@ -0,0 +1,10 @@
// Type definitions for nested-error-stacks 2.1
// Project: https://github.com/mdlavin/nested-error-stacks
// Definitions by: Wouter van Heeswijk <https://github.com/woutervh->
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare class NestedError extends Error {
constructor(message?: any, nested?: Error);
}
export = NestedError;

View File

@@ -0,0 +1,6 @@
import NestedErrorStacks = require('nested-error-stacks');
const error = new NestedErrorStacks('Top level error', new Error('Nested error'));
const message = error.message;
const name = error.name;
const stack = error.stack;

View File

@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"nested-error-stacks-tests.ts"
]
}

View File

@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}