How to check if a string is a directory? I tried casting and using .isDirectory(), not working for me.
Also tried something like this:
let dirs = input.filter(dir => fs.openSync(dir));
but, of course, i get an error when I pass common string. I tried wrapping it into try-catch, didn’t work.