Skip to content
Permalink
Browse files
fix(core): corrected the file location provided with the deprecation …
…message
  • Loading branch information
jan-molak committed Jan 25, 2020
1 parent df1cfd4 commit 170956d90e24d87a7cb866c39173c386e2baed3d
Showing 1 changed file with 5 additions and 1 deletion.
@@ -120,7 +120,11 @@ function deprecated(method: string, message: string) {
const callers = new ErrorStackParser().parse(new Error())
.filter(frame => ! /(node_modules)/.test(frame.fileName));

console.warn(`[${ callers[2].fileName }:${ callers[2].lineNumber }]`, `${ method } has been deprecated. ${ message }`); // tslint:disable-line:no-console
const location = !! callers[2]
? `[${ callers[2].fileName }:${ callers[2].lineNumber }] `
: '';

console.warn(`${ location }${ method } has been deprecated. ${ message }`); // tslint:disable-line:no-console
}

/**

0 comments on commit 170956d

Please sign in to comment.