Skip to content

Commit a27d084

Browse files
allow the check to be a filter function
1 parent 719a94c commit a27d084

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,9 @@ function parser() {
243243
}
244244

245245
if(check.length) {
246-
if(okay !== undefined) {
246+
if(typeof check[0] === 'function') {
247+
emit = check[0](_node)
248+
} else if(okay !== undefined) {
247249
emit = okay.test ? okay.test(_node.type) : okay === _node.type
248250
}
249251
} else {

0 commit comments

Comments
 (0)