@@ -19,7 +19,6 @@ import templateBuilder from '@babel/template';
1919import { createHash } from 'crypto' ;
2020import * as fs from 'fs' ;
2121import * as path from 'path' ;
22- import { lt as semverLt } from 'semver' ;
2322import { RawSourceMap , SourceMapConsumer , SourceMapGenerator } from 'source-map' ;
2423import { minify } from 'terser' ;
2524import * as v8 from 'v8' ;
@@ -884,26 +883,10 @@ function findLocalizePositions(
884883 return positions ;
885884}
886885
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-
891886function unwrapTemplateLiteral (
892887 path : NodePath < types . TaggedTemplateExpression > ,
893888 utils : LocalizeUtilities ,
894889) : [ 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-
907890 const [ messageParts ] = utils . unwrapMessagePartsFromTemplateLiteral (
908891 path . get ( 'quasi' ) . get ( 'quasis' ) ,
909892 ) ;
@@ -916,22 +899,6 @@ function unwrapLocalizeCall(
916899 path : NodePath < types . CallExpression > ,
917900 utils : LocalizeUtilities ,
918901) : [ 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-
935902 const [ messageParts ] = utils . unwrapMessagePartsFromLocalizeCall ( path ) ;
936903 const [ expressions ] = utils . unwrapSubstitutionsFromLocalizeCall ( path ) ;
937904
0 commit comments