Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
watcher.on("change", async (relativePath, stats) => {
const posixRelativePath = toPosixPath(relativePath);
if (!isIgnoredAction("write", posixRelativePath, stats.mtimeMs)) {
logger.debug(
getMessage("Watcher_Change_Reporting_Log", {
path: posixRelativePath
})
);
callback(
posixRelativePath,
await fs.readFile(fullPath(posixRelativePath), "utf8")
);
} else {
logger.debug(
getMessage("Watcher_Change_Ignoring_Log", {
path: posixRelativePath
})
);
removeFromIgnoredActions("write", posixRelativePath);
}
});
},