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
This commit is contained in:
George Kalpakas 2020-06-08 22:04:23 +03:00 committed by Misko Hevery
parent 469d2b4640
commit ab9bc8a9ec
2 changed files with 4 additions and 7 deletions

View File

@ -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;
}
}
}

View File

@ -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