Skip to content

Commit

Permalink
prevent console.table from appending path info.
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Ingram committed Feb 7, 2019
1 parent 1c8c184 commit ada9f08
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ module.exports = () => {

const opts = state.opts;

if (path.node.callee.object && path.node.callee.object.name === 'console') {
if (path.node.callee.object &&
path.node.callee.object.name === 'console' &&
path.node.callee.property.name !== 'table') {

let file = state.file.opts.filename;

Expand All @@ -31,4 +33,4 @@ module.exports = () => {
}
}
};
};
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "babel-plugin-console-source",
"version": "2.0.1",
"version": "2.0.2",
"main": "index.js",
"repository": "https://github.com/peteringram0/babel-console-source",
"author": "Peter Ingram <peter.ingram0@gmail.com>",
Expand Down
8 changes: 6 additions & 2 deletions tests/test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
class Test {

constructor() {
console.log('tesing side test');
console.log('log');
console.warn('warn');
console.info('info');
console.error('error');
console.table(['one', 'two']);
}

}

export default new Test
export default new Test

0 comments on commit ada9f08

Please sign in to comment.