Skip to content

4.0.0

Latest
Compare
Choose a tag to compare
@lahmatiy lahmatiy released this 15 Mar 15:50

Note: Publishing as a stable version. No changes since v4.0.0-rc.1

  • Allowed to pass a string value as an options, it's equivalent to { basedir: <string> }
  • Fixed scanFs() definition to allow omitting of options argument
  • Added resolveSymlinks option to enable symlink resolving, a symlink resolving is disabled by default
  • Added posixPath field to File and Symlink interfaces
  • Added encoding option for Rule to specify an encoding for a file content
  • Changed rule's test option to apply to POSIX paths disregarding of operating system used
  • Changed include and exclude options to take POSIX paths disregarding of operating system used which are supposed to be relative to basedir
  • Changed a returning value of scanFs():
    • Added basedir field
    • Replaced stat object with fields pathsScanned and filesTested
    • Return a plain object instead of File[] array with additional fields
      // before
      const files = await scanFs(...)
      console.log(files, files.symlinks);
      
      // after
      const { files, symlinks } = await scanFs(...)
      console.log(files, symlinks);
  • Renamed NormRule type into MatchRule
  • Added ScanResult type to define returning type of scanFs()
  • Removed output errors to console by default