@@ -56,12 +56,6 @@ interface PackageJson {
56
56
dependencies : Record < string , string > ;
57
57
}
58
58
59
- /**
60
- * Used to temporarily cast types to `any` to unblock the upgrade to TypeScript 4.8.
61
- * TODO(crisbeto): Remove this once https://github.com/angular/angular-cli/pull/23764 is released.
62
- */
63
- type Ts48MigrationAny = any ;
64
-
65
59
export class HammerGesturesMigration extends DevkitMigration < null > {
66
60
// The migration is enabled when v9 or v10 are targeted, but actual targets are only
67
61
// migrated if they are not test targets. We cannot migrate test targets since they have
@@ -736,7 +730,7 @@ export class HammerGesturesMigration extends DevkitMigration<null> {
736
730
737
731
const sourceFile = rootModuleSymbol . valueDeclaration . getSourceFile ( ) ;
738
732
const metadata = getDecoratorMetadata (
739
- sourceFile as Ts48MigrationAny ,
733
+ sourceFile ,
740
734
'NgModule' ,
741
735
'@angular/core' ,
742
736
) as ts . ObjectLiteralExpression [ ] ;
@@ -748,9 +742,9 @@ export class HammerGesturesMigration extends DevkitMigration<null> {
748
742
749
743
const filePath = this . fileSystem . resolve ( sourceFile . fileName ) ;
750
744
const recorder = this . fileSystem . edit ( filePath ) ;
751
- const providersField = getMetadataField ( metadata [ 0 ] as Ts48MigrationAny , 'providers' ) [ 0 ] ;
745
+ const providersField = getMetadataField ( metadata [ 0 ] , 'providers' ) [ 0 ] ;
752
746
const providerIdentifiers = providersField
753
- ? findMatchingChildNodes ( providersField as Ts48MigrationAny , ts . isIdentifier )
747
+ ? findMatchingChildNodes ( providersField , ts . isIdentifier )
754
748
: null ;
755
749
const gestureConfigExpr = this . _importManager . addImportToSourceFile (
756
750
sourceFile ,
@@ -781,7 +775,7 @@ export class HammerGesturesMigration extends DevkitMigration<null> {
781
775
) {
782
776
const symbolName = this . _printNode ( newProviderNode , sourceFile ) ;
783
777
addSymbolToNgModuleMetadata (
784
- sourceFile as Ts48MigrationAny ,
778
+ sourceFile ,
785
779
sourceFile . fileName ,
786
780
'providers' ,
787
781
symbolName ,
@@ -834,17 +828,17 @@ export class HammerGesturesMigration extends DevkitMigration<null> {
834
828
835
829
const sourceFile = rootModuleSymbol . valueDeclaration . getSourceFile ( ) ;
836
830
const metadata = getDecoratorMetadata (
837
- sourceFile as Ts48MigrationAny ,
831
+ sourceFile ,
838
832
'NgModule' ,
839
833
'@angular/core' ,
840
834
) as ts . ObjectLiteralExpression [ ] ;
841
835
if ( ! metadata . length ) {
842
836
return ;
843
837
}
844
838
845
- const importsField = getMetadataField ( metadata [ 0 ] as Ts48MigrationAny , 'imports' ) [ 0 ] ;
839
+ const importsField = getMetadataField ( metadata [ 0 ] , 'imports' ) [ 0 ] ;
846
840
const importIdentifiers = importsField
847
- ? findMatchingChildNodes ( importsField as Ts48MigrationAny , ts . isIdentifier )
841
+ ? findMatchingChildNodes ( importsField , ts . isIdentifier )
848
842
: null ;
849
843
const recorder = this . fileSystem . edit ( this . fileSystem . resolve ( sourceFile . fileName ) ) ;
850
844
const hammerModuleExpr = this . _importManager . addImportToSourceFile (
@@ -861,7 +855,7 @@ export class HammerGesturesMigration extends DevkitMigration<null> {
861
855
) {
862
856
const symbolName = this . _printNode ( hammerModuleExpr , sourceFile ) ;
863
857
addSymbolToNgModuleMetadata (
864
- sourceFile as Ts48MigrationAny ,
858
+ sourceFile ,
865
859
sourceFile . fileName ,
866
860
'imports' ,
867
861
symbolName ,
0 commit comments