@channel.io/bezier-codemod
Advanced tools
Comparing version 0.5.0-alpha.7 to 0.5.0-alpha.8
import { type SourceFile } from 'ts-morph'; | ||
export declare const getImportDeclaration: (sourceFile: SourceFile, specifier: string) => import("ts-morph").ImportDeclaration | undefined; | ||
export declare const getImportDeclarations: (sourceFile: SourceFile, specifier: string) => import("ts-morph").ImportDeclaration[]; | ||
export declare const hasNamedImportInImportDeclaration: (sourceFile: SourceFile, namedImport: string, moduleName: string) => boolean | undefined; | ||
export declare const hasNamedImportInImportDeclaration: (sourceFile: SourceFile, namedImport: string, moduleName: string) => boolean; | ||
export declare const getNamedImport: (sourceFile: SourceFile, namedImport: string) => import("ts-morph").ImportSpecifier | undefined; | ||
@@ -6,0 +6,0 @@ export declare const hasNamedImport: (sourceFile: SourceFile, namedImport: string) => boolean; |
@@ -9,6 +9,6 @@ import { SyntaxKind, } from 'ts-morph'; | ||
export const hasNamedImportInImportDeclaration = (sourceFile, namedImport, moduleName) => { | ||
const importDeclaration = getImportDeclaration(sourceFile, moduleName); | ||
return importDeclaration | ||
?.getNamedImports() | ||
.map((node) => node.getText()) | ||
const importDeclarations = getImportDeclarations(sourceFile, moduleName); | ||
return importDeclarations | ||
.flatMap(v => v?.getNamedImports()) | ||
.map(v => v.getText()) | ||
.includes(namedImport); | ||
@@ -15,0 +15,0 @@ }; |
{ | ||
"name": "@channel.io/bezier-codemod", | ||
"version": "0.5.0-alpha.7", | ||
"version": "0.5.0-alpha.8", | ||
"description": "Codemod transformations to help upgrade app using Bezier design system.", | ||
@@ -5,0 +5,0 @@ "repository": { |
91091