diff --git a/react-packager/src/node-haste/crawlers/watchman.js b/react-packager/src/node-haste/crawlers/watchman.js index 1b29634f..284fe673 100644 --- a/react-packager/src/node-haste/crawlers/watchman.js +++ b/react-packager/src/node-haste/crawlers/watchman.js @@ -70,7 +70,7 @@ function watchmanRecReadDir(roots, {ignore, fileWatcher, exts}) { } function isDescendant(root, child) { - return child.startsWith(root); + return root === child || child.startsWith(root + path.sep); } module.exports = watchmanRecReadDir; diff --git a/react-packager/src/node-haste/fastfs.js b/react-packager/src/node-haste/fastfs.js index 56c6f6a5..ad25c1d5 100644 --- a/react-packager/src/node-haste/fastfs.js +++ b/react-packager/src/node-haste/fastfs.js @@ -362,7 +362,7 @@ function makeReadCallback(fd, predicate, callback) { } function isDescendant(root, child) { - return child.startsWith(root); + return root === child || child.startsWith(root + path.sep); } module.exports = Fastfs;