From ab9bc8a9ecc6a6a4ac27de7a56d901ed44430a10 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Mon, 8 Jun 2020 22:04:23 +0300 Subject: [PATCH] refactor(ngcc): clean up unused imports, unused regex parenthesis, typos (#37040) This is a follow-up to #37075, because I didn't manage to finish my review before the PR got merged. PR Close #37040 --- .../ngcc/src/dependencies/esm_dependency_host.ts | 4 ++-- .../src/entry_point_finder/targeted_entry_point_finder.ts | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/compiler-cli/ngcc/src/dependencies/esm_dependency_host.ts b/packages/compiler-cli/ngcc/src/dependencies/esm_dependency_host.ts index 5ce08b8493..68890f25c4 100644 --- a/packages/compiler-cli/ngcc/src/dependencies/esm_dependency_host.ts +++ b/packages/compiler-cli/ngcc/src/dependencies/esm_dependency_host.ts @@ -263,7 +263,7 @@ export class EsmDependencyHost extends DependencyHostBase { * in this file, true otherwise. */ export function hasImportOrReexportStatements(source: string): boolean { - return /(?:import|export)[\s\S]+?(["'])(?:(?:\\\1|.)*?)\1/.test(source); + return /(?:import|export)[\s\S]+?(["'])(?:\\\1|.)+?\1/.test(source); } @@ -299,4 +299,4 @@ function canPrecedeARegex(kind: ts.SyntaxKind): boolean { default: return true; } -} \ No newline at end of file +} diff --git a/packages/compiler-cli/ngcc/src/entry_point_finder/targeted_entry_point_finder.ts b/packages/compiler-cli/ngcc/src/entry_point_finder/targeted_entry_point_finder.ts index 4bf2f113d3..834ee6a17f 100644 --- a/packages/compiler-cli/ngcc/src/entry_point_finder/targeted_entry_point_finder.ts +++ b/packages/compiler-cli/ngcc/src/entry_point_finder/targeted_entry_point_finder.ts @@ -5,18 +5,15 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ -import {AbsoluteFsPath, FileSystem, join, PathSegment, relative, relativeFrom} from '../../../src/ngtsc/file_system'; -import {EntryPointWithDependencies} from '../dependencies/dependency_host'; +import {AbsoluteFsPath, FileSystem} from '../../../src/ngtsc/file_system'; import {DependencyResolver, SortedEntryPointsInfo} from '../dependencies/dependency_resolver'; import {Logger} from '../logging/logger'; import {hasBeenProcessed} from '../packages/build_marker'; import {NgccConfiguration} from '../packages/configuration'; -import {EntryPoint, EntryPointJsonProperty, getEntryPointInfo, INCOMPATIBLE_ENTRY_POINT, NO_ENTRY_POINT} from '../packages/entry_point'; +import {EntryPointJsonProperty} from '../packages/entry_point'; import {PathMappings} from '../path_mappings'; -import {EntryPointFinder} from './interface'; import {TracingEntryPointFinder} from './tracing_entry_point_finder'; -import {getBasePaths} from './utils'; /** * An EntryPointFinder that starts from a target entry-point and only finds