From 18481aa6b0d8ad778f97d9480342d508c7ffb41b Mon Sep 17 00:00:00 2001 From: Valery Aligorsky Date: Sun, 29 Aug 2021 12:49:49 +0200 Subject: [PATCH] fix(types): fix typo in the Type name, RegisteredImport BREAKING CHANGE: has to import another type of needed. --- lib/fileAnalyzer.ts | 4 ++-- lib/importRegistry.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/fileAnalyzer.ts b/lib/fileAnalyzer.ts index accfba2..b2440fc 100644 --- a/lib/fileAnalyzer.ts +++ b/lib/fileAnalyzer.ts @@ -1,7 +1,7 @@ import fs from 'fs-extra'; import stripComments from 'strip-json-comments'; import { ExportsAnalyzer, ExportsAnalyzerResult } from './exportsAnalyzer'; -import { RegistredImport } from './importRegistry'; +import { RegisteredImport } from './importRegistry'; import { ImportsAnalyzer, ImportsAnalyzerResult } from './importsAnalyzer'; import { ExportType } from './types'; @@ -15,7 +15,7 @@ export class FileAnalyzer { analyzedFile: FileAnalyzerResult, e: ExportsAnalyzerResult, newName: string | null, - globalRenames: RegistredImport[], + globalRenames: RegisteredImport[], ): string { if (e.type === ExportType.comment) { return e.body; diff --git a/lib/importRegistry.ts b/lib/importRegistry.ts index ba3c939..6a5b854 100644 --- a/lib/importRegistry.ts +++ b/lib/importRegistry.ts @@ -1,4 +1,4 @@ -export interface RegistredImport { +export interface RegisteredImport { file: string; name: string; as?: string | null; @@ -7,7 +7,7 @@ export interface RegistredImport { export class ImportsRegistry { registeredImportStatements: string[] = []; - registeredImports: RegistredImport[] = []; + registeredImports: RegisteredImport[] = []; isImportProcessed(importStatement?: string): boolean { if (!importStatement) { @@ -20,11 +20,11 @@ export class ImportsRegistry { this.registeredImportStatements.push(importStatement); } - registerImport(i: RegistredImport): void { + registerImport(i: RegisteredImport): void { this.registeredImports.push(i); } - getGlobalImports(): RegistredImport[] { + getGlobalImports(): RegisteredImport[] { return this.registeredImports.filter((i) => i.globalRename); }