node_modules/lit-analyzer/lib/index.cjs.js
/**
 * Returns a map of component declarations in each file encountered from a source file recursively.
 * @param sourceFile
 * @param context
 */
Returns a map of component declarations in each file encountered from a source file recursively.
@param sourceFile
@param context
Returns a map of component declarations in each file encountered from a source file recursively . @param sourceFile @param context
function parseDependencies(sourceFile, context) {
    var definitions = [];
    visitDependencies(sourceFile, {
        project: context.project,
        program: context.program,
        ts: context.ts,
        lockedFiles: [],
        addDefinitionsForFile: function (file, results, isCircular) {
            if (!isCircular) {
                map.set(file, results);
            }
            if (file === sourceFile) {
                definitions = Array.from(new Set(results));
            }
        },
        getImportedDefinitionsInFile: function (file) {
            return map.get(file);
        },
        getDefinitionsInFile: function (file) {
            return context.definitionStore.getDefinitionsInFile(file);
        },
        addCircularReference: function (fromFile, toFile) { }
    });
    return definitions;
}
function parseDependencies ( sourceFile , context ) { var definitions = [ ] ; visitDependencies ( sourceFile , { project : context . project , program : context . program , ts : context . ts , lockedFiles : [ ] , addDefinitionsForFile : function ( file , results , isCircular ) { if ( ! isCircular ) { map . set ( file , results ) ; } if ( file === sourceFile ) { definitions = Array . from ( new Set ( results ) ) ; } } , getImportedDefinitionsInFile : function ( file ) { return map . get ( file ) ; } , getDefinitionsInFile : function ( file ) { return context . definitionStore . getDefinitionsInFile ( file ) ; } , addCircularReference : function ( fromFile , toFile ) { } } ) ; return definitions ; }
Returns a map of component declarations in each file encountered from a source file recursively.
Returns a map of component declarations in each file encountered from a source file recursively .
// Only set the result if this isn't a circular import and file is equal to the start file. // Always safe the definitions if the results comes from this file