Skip to content

Commit ebb4850

Browse files
author
Christoph Bühler
committed
fix isNew determination
1 parent aadc9ae commit ebb4850

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

src/imports/DefaultImport.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { AliasedImport } from './Import';
1010
*/
1111
export class DefaultImport implements AliasedImport {
1212
public get isNew(): boolean {
13-
return this.start !== undefined && this.end !== undefined;
13+
return this.start === undefined || this.end === undefined;
1414
}
1515

1616
constructor(public libraryName: string, public alias: string, public start?: number, public end?: number) { }

src/imports/ExternalModuleImport.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { AliasedImport } from './Import';
1010
*/
1111
export class ExternalModuleImport implements AliasedImport {
1212
public get isNew(): boolean {
13-
return this.start !== undefined && this.end !== undefined;
13+
return this.start === undefined || this.end === undefined;
1414
}
1515

1616
constructor(public libraryName: string, public alias: string, public start?: number, public end?: number) { }

src/imports/NamedImport.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class NamedImport implements Import {
1414
public specifiers: SymbolSpecifier[] = [];
1515

1616
public get isNew(): boolean {
17-
return this.start !== undefined && this.end !== undefined;
17+
return this.start === undefined || this.end === undefined;
1818
}
1919

2020
constructor(public libraryName: string, public start?: number, public end?: number) { }

src/imports/NamespaceImport.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { AliasedImport } from './Import';
99
*/
1010
export class NamespaceImport implements AliasedImport {
1111
public get isNew(): boolean {
12-
return this.start !== undefined && this.end !== undefined;
12+
return this.start === undefined || this.end === undefined;
1313
}
1414

1515
constructor(public libraryName: string, public alias: string, public start?: number, public end?: number) { }

src/imports/StringImport.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Import } from './Import';
99
*/
1010
export class StringImport implements Import {
1111
public get isNew(): boolean {
12-
return this.start !== undefined && this.end !== undefined;
12+
return this.start === undefined || this.end === undefined;
1313
}
1414

1515
constructor(public libraryName: string, public start?: number, public end?: number) { }

0 commit comments

Comments
 (0)