Typescript check if file exists. Improve this question.