Style: `pathSep` is always a regex (in `baseFileName`).
Check only once if `path.sep` is windows-style (and memorize it).