Add 'error' check

It should check for errors now.

```js
'error' === type(new Error("Something wrong!")); // true
```