@@ -19,7 +19,6 @@ import templateBuilder from '@babel/template';
19
19
import { createHash } from 'crypto' ;
20
20
import * as fs from 'fs' ;
21
21
import * as path from 'path' ;
22
- import { lt as semverLt } from 'semver' ;
23
22
import { RawSourceMap , SourceMapConsumer , SourceMapGenerator } from 'source-map' ;
24
23
import { minify } from 'terser' ;
25
24
import * as v8 from 'v8' ;
@@ -884,26 +883,10 @@ function findLocalizePositions(
884
883
return positions ;
885
884
}
886
885
887
- // TODO: Remove this for v11.
888
- // This check allows the CLI to support both FW 10.0 and 10.1
889
- let localizeOld : boolean | undefined ;
890
-
891
886
function unwrapTemplateLiteral (
892
887
path : NodePath < types . TaggedTemplateExpression > ,
893
888
utils : LocalizeUtilities ,
894
889
) : [ TemplateStringsArray , types . Expression [ ] ] {
895
- if ( localizeOld === undefined ) {
896
- const { version : localizeVersion } = require ( '@angular/localize/package.json' ) ;
897
- localizeOld = semverLt ( localizeVersion , '10.1.0-rc.0' , { includePrerelease : true } ) ;
898
- }
899
-
900
- if ( localizeOld ) {
901
- // tslint:disable-next-line: no-any
902
- const messageParts = utils . unwrapMessagePartsFromTemplateLiteral ( path . node . quasi . quasis as any ) ;
903
-
904
- return [ ( messageParts as unknown ) as TemplateStringsArray , path . node . quasi . expressions ] ;
905
- }
906
-
907
890
const [ messageParts ] = utils . unwrapMessagePartsFromTemplateLiteral (
908
891
path . get ( 'quasi' ) . get ( 'quasis' ) ,
909
892
) ;
@@ -916,22 +899,6 @@ function unwrapLocalizeCall(
916
899
path : NodePath < types . CallExpression > ,
917
900
utils : LocalizeUtilities ,
918
901
) : [ TemplateStringsArray , types . Expression [ ] ] {
919
- if ( localizeOld === undefined ) {
920
- const { version : localizeVersion } = require ( '@angular/localize/package.json' ) ;
921
- localizeOld = semverLt ( localizeVersion , '10.1.0-rc.0' , { includePrerelease : true } ) ;
922
- }
923
-
924
- if ( localizeOld ) {
925
- const messageParts = utils . unwrapMessagePartsFromLocalizeCall ( path ) ;
926
- // tslint:disable-next-line: no-any
927
- const expressions = utils . unwrapSubstitutionsFromLocalizeCall ( path . node as any ) ;
928
-
929
- return [
930
- ( messageParts as unknown ) as TemplateStringsArray ,
931
- ( expressions as unknown ) as types . Expression [ ] ,
932
- ] ;
933
- }
934
-
935
902
const [ messageParts ] = utils . unwrapMessagePartsFromLocalizeCall ( path ) ;
936
903
const [ expressions ] = utils . unwrapSubstitutionsFromLocalizeCall ( path ) ;
937
904
0 commit comments