Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
testFiles.forEach(file => {
// skip source files from node_modules
// https://github.com/mikeerickson/todo-webpack-plugin/issues/21
if (file.match(/node_modules/g)) {
return;
}
if (options.skipUnsupported) {
if (!leasot.isExtSupported(path.extname(file))) {
return;
}
}
const todo = leasot.parse({
ext: path.extname(file),
content: fs.readFileSync(file, 'utf8'),
fileName: file,
customTags: options.tags,
reporter: options.reporter,
withInlineFiles: options.withInlineFiles
});
todos = todos.concat(todo);
});
processString(content, relativePath) {
if (this.enabled) {
const fileExtension = path.extname(relativePath);
if (leasot.isExtSupported(fileExtension)) {
this._markers.push(leasot.parse({
ext: fileExtension,
content: content,
fileName: relativePath,
customTags: this.kinds
}));
} else {
this._exceptions.push(fileExtension);
}
}
return content;
}