@nitra/cursor 1.8.180 → 1.8.184

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,7 +17,9 @@ import { isAbsolute, join, resolve, sep } from 'node:path'
17
17
  */
18
18
  function toAbsPosix(p) {
19
19
  const abs = isAbsolute(p) ? p : resolve(p)
20
- return abs.split(sep).join('/').replace(/\/+$/, '')
20
+ let posix = abs.split(sep).join('/')
21
+ while (posix.endsWith('/')) posix = posix.slice(0, -1)
22
+ return posix
21
23
  }
22
24
 
23
25
  /**
@@ -43,7 +45,7 @@ function isIgnoredDir(dirAbsPosix, ignorePosix) {
43
45
  * @returns {Promise<void>} резолвиться по завершенню обходу
44
46
  */
45
47
  export async function walkDir(dir, onFile, ignorePaths = []) {
46
- const ignorePosix = ignorePaths.map(toAbsPosix)
48
+ const ignorePosix = ignorePaths.map(p => toAbsPosix(p))
47
49
  await walkDirInner(dir, onFile, ignorePosix)
48
50
  }
49
51