@dev-thought/nx-deploy-it
Version:
[](https://www.npmjs.com/package/@dev-thought/nx-deploy-it) [](http://opensource.
14 lines (12 loc) • 404 B
text/typescript
import * as ts from 'typescript';
export function hasImport(
statements: ts.NodeArray<ts.Statement>,
importModule: string
): boolean {
return !!statements
.filter(node => {
return node.kind === ts.SyntaxKind.ImportDeclaration;
})
.map((node: ts.ImportDeclaration) => (node.moduleSpecifier as any).text)
.find((importName: string) => importName.indexOf(importModule) > -1);
}