Sure, but move that part bellow

```js
if (assetType === '.zip' || assetType === 'tar')..
```
Also we don't want to throw an error but emit a warn, search for `emit('warn')` for an example.
The check itself is also not ok:

````js
if(matches[1].indexOf('.tar.gz')!==-1){
````
This will be true for `some.tar.gz.file.zip` which is not ok.. you want to compare against the end of the string.