From 9ef5c613ff555df7316016c2880baab8dbfa2768 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Fri, 5 Jun 2020 18:41:48 +0300 Subject: [PATCH] refactor(ngcc): clean up unused imports, unused regex parenthesis, typos This is a follow-up to #37075, because I didn't manage to finish my review before the PR got merged. --- .../ngcc/src/dependencies/esm_dependency_host.ts | 4 ++-- .../src/entry_point_finder/targeted_entry_point_finder.ts | 7 ++----- .../src/entry_point_finder/tracing_entry_point_finder.ts | 2 +- 3 files changed, 5 insertions(+), 8 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 c8ad1718bf525b..79a1ccc14b7d7a 100644 --- a/packages/compiler-cli/ngcc/src/dependencies/esm_dependency_host.ts +++ b/packages/compiler-cli/ngcc/src/dependencies/esm_dependency_host.ts @@ -225,7 +225,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); } @@ -261,4 +261,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 4bf2f113d3d87f..834ee6a17f83cb 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 diff --git a/packages/compiler-cli/ngcc/src/entry_point_finder/tracing_entry_point_finder.ts b/packages/compiler-cli/ngcc/src/entry_point_finder/tracing_entry_point_finder.ts index 6f4f0c00885f66..50e66b9a7e88a3 100644 --- a/packages/compiler-cli/ngcc/src/entry_point_finder/tracing_entry_point_finder.ts +++ b/packages/compiler-cli/ngcc/src/entry_point_finder/tracing_entry_point_finder.ts @@ -24,7 +24,7 @@ import {getBasePaths} from './utils'; * This is faster than searching the entire file-system for all the entry-points, * and is used primarily by the CLI integration. * - * There are two concrete implementation of this class. + * There are two concrete implementations of this class. * * * `TargetEntryPointFinder` - is given a single entry-point as the initial entry-point * * `ProgramBasedEntryPointFinder` - computes the initial entry-points from program files given by