Add get-caller-file

This commit is contained in:
Klaus Meinhardt 2018-02-03 22:22:13 +01:00
parent 8058968995
commit c3ae41c571
4 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,4 @@
import getCallerFile = require('get-caller-file');
let caller: string = getCallerFile();
caller = getCallerFile(3);

9
types/get-caller-file/index.d.ts vendored Normal file
View File

@ -0,0 +1,9 @@
// Type definitions for get-caller-file 1.0
// Project: https://github.com/stefanpenner/get-caller-file#readme
// Definitions by: My Self <https://github.com/me>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function getCallerFile(position?: number): string;
declare namespace getCallerFile {}
export = getCallerFile;

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",
"get-caller-file-tests.ts"
]
}

View File

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