@componentor/fs 3.0.6 → 3.0.7

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.
package/README.md CHANGED
@@ -509,6 +509,11 @@ Make sure `opfsSync` is enabled (it's `true` by default). Files are mirrored to
509
509
 
510
510
  ## Changelog
511
511
 
512
+ ### v3.0.7 (2026)
513
+
514
+ **Fixes:**
515
+ - Fix `fs.watch()` path matching for root `/` watchers — watching `/` now correctly matches all child paths instead of missing them due to an off-by-one boundary check
516
+
512
517
  ### v3.0.6 (2026)
513
518
 
514
519
  **Performance:**
package/dist/index.js CHANGED
@@ -1080,10 +1080,11 @@ function matchWatcher(entry, mutatedPath) {
1080
1080
  if (mutatedPath === absPath) {
1081
1081
  return basename(mutatedPath);
1082
1082
  }
1083
- if (!mutatedPath.startsWith(absPath) || mutatedPath.charAt(absPath.length) !== "/") {
1083
+ const prefix = absPath.endsWith("/") ? absPath : absPath + "/";
1084
+ if (!mutatedPath.startsWith(prefix)) {
1084
1085
  return null;
1085
1086
  }
1086
- const relativePath = mutatedPath.substring(absPath.length + 1);
1087
+ const relativePath = mutatedPath.substring(prefix.length);
1087
1088
  if (recursive) return relativePath;
1088
1089
  return relativePath.indexOf("/") === -1 ? relativePath : null;
1089
1090
  }