Skip to content

Commit

Permalink
refactor canConvert
Browse files Browse the repository at this point in the history
  • Loading branch information
notslang committed May 13, 2016
1 parent 4f9f5e3 commit 9a1edc5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,13 @@ getContent = (node) ->

canConvert = (node, filter) ->
if typeof filter is 'string'
return filter is node.tagName
if Array.isArray(filter)
return node.tagName in filter
filter is node.tagName
else if Array.isArray(filter)
node.tagName in filter
else if typeof filter is 'function'
return filter(node)
filter(node)
else
throw new TypeError('`filter` needs to be a string, array, or function')
return

findConverter = (node) ->
for converter in converters
Expand Down

0 comments on commit 9a1edc5

Please sign in to comment.