Why are we getting a non element here?

Maybe we should change the `assert` to

asssert(element && element.nodeType === Node.ELEMENT_TYPE);

If we accept non elements, the param should be renamed to `node` and the test be:

```js
if (element.nodeType === Node.ELEMENT_TYPE && element.hasAttributes())
```