scripts/package-integrity.js
function getImports(sourceFile) {
    var imports = [];
    handleNode(sourceFile);

    function handleNode(node) {
        switch (node.kind) {
            case ts.SyntaxKind.ImportDeclaration:
                imports.push(node.moduleSpecifier.text);
                break;
            case ts.SyntaxKind.ImportEqualsDeclaration:
                imports.push(node.moduleReference.expression.text);
                break;
        }
        ts.forEachChild(node, handleNode);
    }
    return imports;
}
function getImports(sourceFile) {
    var imports = [];
    handleNode(sourceFile);

    function handleNode(node) {
        switch (node.kind) {
            case ts.SyntaxKind.ImportDeclaration:
                imports.push(node.moduleSpecifier.text);
                break;
            case ts.SyntaxKind.ImportEqualsDeclaration:
                imports.push(node.moduleReference.expression.text);
                break;
        }
        ts.forEachChild(node, handleNode);
    }
    return imports;
}
function getImports ( sourceFile ) { var imports = [ ] ; handleNode ( sourceFile ) ; function handleNode ( node ) { switch ( node . kind ) { case ts . SyntaxKind . ImportDeclaration : imports . push ( node . moduleSpecifier . text ) ; break ; case ts . SyntaxKind . ImportEqualsDeclaration : imports . push ( node . moduleReference . expression . text ) ; break ; } ts . forEachChild ( node , handleNode ) ; } return imports ; }
Extract the module imports from a TypeScript source file.
Extract the module imports from a TypeScript source file .