Merge pull request #23396 from ajafff/get-caller-file

Add get-caller-file
This commit is contained in:
Daniel Rosenwasser
2018-02-15 10:59:46 -08:00
committed by GitHub
4 changed files with 37 additions and 0 deletions
@@ -0,0 +1,4 @@
import getCallerFile = require('get-caller-file');
let caller: string = getCallerFile();
caller = getCallerFile(3);
+8
View File
@@ -0,0 +1,8 @@
// Type definitions for get-caller-file 1.0
// Project: https://github.com/stefanpenner/get-caller-file#readme
// Definitions by: Klaus Meinhardt <https://github.com/ajafff>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function getCallerFile(position?: number): string;
export = getCallerFile;
+24
View File
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"esModuleInterop": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"get-caller-file-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }