Skip to content

Commit

Permalink
add debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
eush77 committed Dec 19, 2015
1 parent 354a9b7 commit 896d376
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
var parseSelector = require('./lib/selector')(),
select = require('./lib/select');

var debug = require('debug')('unist-util-select');


module.exports = function (ast, selector) {
debug('Selector: %j', selector);
selector = parseSelector(selector);
debug('AST: %s',
JSON.stringify(selector, null, 2).replace(/(^|\n)/g, '\n '));
return selector ? select[selector.type](selector, ast) : [];
};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
"walk"
],
"dependencies": {
"css-selector-parser": "^1.1.0"
"css-selector-parser": "^1.1.0",
"debug": "^2.2.0"
},
"devDependencies": {
"tape": "^4.2.0"
Expand Down

0 comments on commit 896d376

Please sign in to comment.