Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (file.isNull()) {
cb(null, file);
return;
}
if (file.isStream()) {
cb(new PluginError(pluginName, 'Streaming not supported'));
return;
}
firstFile = firstFile || file;
//get extension - assume .js as default
const ext = path.extname(file.path) || '.js';
//check if parser for filetype exists
if (!leasot.isExtensionSupported(ext)) {
if (!skipUnsupported) {
const msg = `File: ${file.path} with extension ${colors.red(ext)} is not supported`;
return cb(new PluginError(pluginName, msg));
}
if (verbose) {
const msg = `Skipping file ${file.path} with extension ${colors.red(ext)} as it is unsupported`;
fancyLog(msg);
}
return cb();
}
const filePath = absolute ? file.path : (file.path && file.relative) || file.path;
const parsedComments = leasot.parse(file.contents.toString(), {
associateParser: parseOptions.associateParser,
customParsers: parseOptions.customParsers,
customTags: parseOptions.customTags,