Added check for file type

Giving up on unit testing due to typescript.