@@ -7433,6 +7433,7 @@ var require_lrucache = __commonJS({
7433
7433
//
7434
7434
var require_range = __commonJS ( {
7435
7435
"" ( exports , module ) {
7436
+ var SPACE_CHARACTERS = / \s + / g;
7436
7437
var Range = class {
7437
7438
constructor ( range , options ) {
7438
7439
options = parseOptions ( options ) ;
@@ -7446,13 +7447,13 @@ var require_range = __commonJS({
7446
7447
if ( range instanceof Comparator ) {
7447
7448
this . raw = range . value ;
7448
7449
this . set = [ [ range ] ] ;
7449
- this . format ( ) ;
7450
+ this . formatted = void 0 ;
7450
7451
return this ;
7451
7452
}
7452
7453
this . options = options ;
7453
7454
this . loose = ! ! options . loose ;
7454
7455
this . includePrerelease = ! ! options . includePrerelease ;
7455
- this . raw = range . trim ( ) . split ( / \s + / ) . join ( " " ) ;
7456
+ this . raw = range . trim ( ) . replace ( SPACE_CHARACTERS , " " ) ;
7456
7457
this . set = this . raw . split ( "||" ) . map ( ( r ) => this . parseRange ( r . trim ( ) ) ) . filter ( ( c ) => c . length ) ;
7457
7458
if ( ! this . set . length ) {
7458
7459
throw new TypeError ( `Invalid SemVer Range: ${ this . raw } ` ) ;
@@ -7471,10 +7472,27 @@ var require_range = __commonJS({
7471
7472
}
7472
7473
}
7473
7474
}
7474
- this . format ( ) ;
7475
+ this . formatted = void 0 ;
7476
+ }
7477
+ get range ( ) {
7478
+ if ( this . formatted === void 0 ) {
7479
+ this . formatted = "" ;
7480
+ for ( let i = 0 ; i < this . set . length ; i ++ ) {
7481
+ if ( i > 0 ) {
7482
+ this . formatted += "||" ;
7483
+ }
7484
+ const comps = this . set [ i ] ;
7485
+ for ( let k = 0 ; k < comps . length ; k ++ ) {
7486
+ if ( k > 0 ) {
7487
+ this . formatted += " " ;
7488
+ }
7489
+ this . formatted += comps [ k ] . toString ( ) . trim ( ) ;
7490
+ }
7491
+ }
7492
+ }
7493
+ return this . formatted ;
7475
7494
}
7476
7495
format ( ) {
7477
- this . range = this . set . map ( ( comps ) => comps . join ( " " ) . trim ( ) ) . join ( "||" ) . trim ( ) ;
7478
7496
return this . range ;
7479
7497
}
7480
7498
toString ( ) {
0 commit comments