Isn't this just checking if the given file is a directory? What's wrong with using node's `Stat#isDirectory()`?