node_modules/lit-analyzer/lib/index.cjs.js
/**
 * Parses and analyses all globs and calls some callbacks while doing it.
 * @param globs
 * @param config
 * @param context
 */
Parses and analyses all globs and calls some callbacks while doing it.
Parses and analyses all globs and calls some callbacks while doing it .
function analyzeGlobs(globs, config, context) {
    if (context === void 0) { context = {}; }
    return __awaiter(this, void 0, void 0, function () {
        var filePaths, _a, program, files, diagnostics, files_1, files_1_1, file, result;
        var e_1, _b;
        return __generator(this, function (_c) {
            switch (_c.label) {
                case 0: return [4 , expandGlobs(globs)];
                case 1:
                    filePaths = _c.sent();
                    if (config.debug) {
                        console.log(filePaths);
                    }
                    if (context.didExpandGlobs != null)
                        context.didExpandGlobs(filePaths);
                    if (context.willAnalyzeFiles != null)
                        context.willAnalyzeFiles(filePaths);
                    _a = compileTypescript(filePaths), program = _a.program, files = _a.files, diagnostics = _a.diagnostics;
                    if (diagnostics.length > 0) {
                        if (config.debug) {
                            console.dir(diagnostics.map(function (d) { return ((d.file && d.file.fileName) || "unknown") + ": " + tsModuleType.flattenDiagnosticMessageText(d.messageText, "\n"); }));
                        }
                        if (context.didFindTypescriptDiagnostics != null)
                            context.didFindTypescriptDiagnostics(diagnostics, { program: program });
                    }
                    try {
                        for (files_1 = __values(files), files_1_1 = files_1.next(); !files_1_1.done; files_1_1 = files_1.next()) {
                            file = files_1_1.value;
                            if (context.analyzeSourceFile != null) {
                                result = context.analyzeSourceFile(file, { program: program });
                                if (result === false)
                                    break;
                            }
                        }
                    }
                    catch (e_1_1) { e_1 = { error: e_1_1 }; }
                    finally {
                        try {
                            if (files_1_1 && !files_1_1.done && (_b = files_1.return)) _b.call(files_1);
                        }
                        finally { if (e_1) throw e_1.error; }
                    }
                    return [2 , { program: program, diagnostics: diagnostics, files: files }];
            }
        });
    });
}
function analyzeGlobs ( globs , config , context ) { if ( context === void 0 ) { context = { } ; } return __awaiter ( this , void 0 , void 0 , function ( ) { var filePaths , _a , program , files , diagnostics , files_1 , files_1_1 , file , result ; var e_1 , _b ; return __generator ( this , function ( _c ) { switch ( _c . label ) { case 0 : return [ 4 , expandGlobs ( globs ) ] ; case 1 : filePaths = _c . sent ( ) ; if ( config . debug ) { console . log ( filePaths ) ; } if ( context . didExpandGlobs != null ) context . didExpandGlobs ( filePaths ) ; if ( context . willAnalyzeFiles != null ) context . willAnalyzeFiles ( filePaths ) ; _a = compileTypescript ( filePaths ) , program = _a . program , files = _a . files , diagnostics = _a . diagnostics ; if ( diagnostics . length > 0 ) { if ( config . debug ) { console . dir ( diagnostics . map ( function ( d ) { return ( ( d . file && d . file . fileName ) || "unknown" ) + ": " + tsModuleType . flattenDiagnosticMessageText ( d . messageText , "\n" ) ; } ) ) ; } if ( context . didFindTypescriptDiagnostics != null ) context . didFindTypescriptDiagnostics ( diagnostics , { program : program } ) ; } try { for ( files_1 = __values ( files ) , files_1_1 = files_1 . next ( ) ; ! files_1_1 . done ; files_1_1 = files_1 . next ( ) ) { file = files_1_1 . value ; if ( context . analyzeSourceFile != null ) { result = context . analyzeSourceFile ( file , { program : program } ) ; if ( result === false ) break ; } } } catch ( e_1_1 ) { e_1 = { error : e_1_1 } ; } finally { try { if ( files_1_1 && ! files_1_1 . done && ( _b = files_1 . return ) ) _b . call ( files_1 ) ; } finally { if ( e_1 ) throw e_1 . error ; } } return [ 2 , { program : program , diagnostics : diagnostics , files : files } ] ; } } ) ; } ) ; }
Parses and analyses all globs and calls some callbacks while doing it.
Parses and analyses all globs and calls some callbacks while doing it .
/*yield*/ // eslint-disable-next-line no-console // Callbacks // eslint-disable-next-line no-console // Analyze each file // Analyze /*return*/