function normalizeModuleAndLoadMetadata(programPath) {

    nameAnonymousExports(programPath);

    const {local, source} = getModuleMetadata(programPath);

    removeModuleDeclarations(programPath);

    // Reuse the imported namespace name if there is one.
    for (const [, metadata] of source) {
        if (metadata.importsNamespace.size > 0) {
            // This is kind of gross. If we stop using `loose: true` we should
            // just make this destructuring assignment.
            metadata.name = metadata.importsNamespace.values().next().value;
        }
    }

    return {
        exportName: 'exports',
        exportNameListName: null,
        local,
        source
    };
}
function normalizeModuleAndLoadMetadata(programPath) {

    nameAnonymousExports(programPath);

    const {local, source} = getModuleMetadata(programPath);

    removeModuleDeclarations(programPath);

    // Reuse the imported namespace name if there is one.
    for (const [, metadata] of source) {
        if (metadata.importsNamespace.size > 0) {
            // This is kind of gross. If we stop using `loose: true` we should
            // just make this destructuring assignment.
            metadata.name = metadata.importsNamespace.values().next().value;
        }
    }

    return {
        exportName: 'exports',
        exportNameListName: null,
        local,
        source
    };
}
function normalizeModuleAndLoadMetadata ( programPath ) { nameAnonymousExports ( programPath ) ; const { local , source } = getModuleMetadata ( programPath ) ; removeModuleDeclarations ( programPath ) ; // Reuse the imported namespace name if there is one. for ( const [ , metadata ] of source ) { if ( metadata . importsNamespace . size > 0 ) { // This is kind of gross. If we stop using `loose: true` we should // just make this destructuring assignment. metadata . name = metadata . importsNamespace . values ( ) . next ( ) . value ; } } return { exportName : 'exports' , exportNameListName : null , local , source } ; }
Remove all imports and exports from the file, and return all metadata
needed to reconstruct the module's behavior.
@return {ModuleMetadata}
Remove all imports and exports from the file and return all metadata needed to reconstruct the module s behavior .
Normalize the module and load the metadata