is-valid-path-with-extension
Returns true if a file path has valid characters and file extension matches.
Based on is-valid-path. Thanks jonschlinkert.
Here is a way to tell if string is a valid path of a particular file type. It's essentially is-valid-path with a second argument for a regex pattern. 🙂
// true // null // true // null