If the arguments to compareSync are two files, then the result of comparison is a little odd: it seems they are treated as if they were each contained in a directory, so the files are only considered the same if their names are the same.
But compareSync applied to two directories compares their contents; it should do the same for files.
I came across this issue because I have some code that normally compares directories, but in some cases it may only compare single files, and I had to special case this and not use dir-compare for the single files.
Thanks for dir-compare! A very handy piece of code.
If the arguments to
compareSyncare two files, then the result of comparison is a little odd: it seems they are treated as if they were each contained in a directory, so the files are only considered the same if their names are the same.But
compareSyncapplied to two directories compares their contents; it should do the same for files.I came across this issue because I have some code that normally compares directories, but in some cases it may only compare single files, and I had to special case this and not use
dir-comparefor the single files.Thanks for
dir-compare! A very handy piece of code.