How to use the leasot.isExtensionSupported function in leasot

To help you get started, we’ve selected a few leasot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pgilad / gulp-todo / index.js View on Github external
if (file.isNull()) {
                cb(null, file);

            if (file.isStream()) {
                cb(new PluginError(pluginName, 'Streaming not supported'));
            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 ${} is not supported`;
                    return cb(new PluginError(pluginName, msg));
                if (verbose) {
                    const msg = `Skipping file ${file.path} with extension ${} as it is unsupported`;
                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,


Parse and output TODOs and FIXMEs from comments in your files

Latest version published 5 months ago

Package Health Score

76 / 100
Full package analysis