Skip to content

Commit

Permalink
fix: array from null
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Aug 7, 2020
1 parent e3277c4 commit 2a105be
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/vanilla/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ function parseObject (obj) {
}

function toArray (selector) {
return Array.from(
const elements =
typeof selector === 'string'
? document.querySelectorAll(selector)
: selector
)

return elements ? Array.from(elements) : []
}

function microlink (selector, opts, rootNode) {
Expand Down

0 comments on commit 2a105be

Please sign in to comment.