@@ -1526,7 +1526,10 @@ define('save-exact', {
1526
1526
Dependencies saved to package.json will be configured with an exact
1527
1527
version rather than using npm's default semver range operator.
1528
1528
` ,
1529
- flatten,
1529
+ flatten ( key , obj , flatOptions ) {
1530
+ // just call the save-prefix flattener, it reads from obj['save-exact']
1531
+ definitions [ 'save-prefix' ] . flatten ( 'save-prefix' , obj , flatOptions )
1532
+ } ,
1530
1533
} )
1531
1534
1532
1535
define ( 'save-optional' , {
@@ -1595,6 +1598,7 @@ define('save-prefix', {
1595
1598
` ,
1596
1599
flatten ( key , obj , flatOptions ) {
1597
1600
flatOptions . savePrefix = obj [ 'save-exact' ] ? '' : obj [ 'save-prefix' ]
1601
+ obj [ 'save-prefix' ] = flatOptions . savePrefix
1598
1602
} ,
1599
1603
} )
1600
1604
@@ -1970,6 +1974,11 @@ define('user-agent', {
1970
1974
. replace ( / \{ a r c h \} / gi, process . arch )
1971
1975
. replace ( / \{ c i \} / gi, ciName ? `ci/${ ciName } ` : '' )
1972
1976
. trim ( )
1977
+ // user-agent is a unique kind of config item that gets set from a template
1978
+ // and ends up translated. Because of this, the normal "should we set this
1979
+ // to process.env also doesn't work
1980
+ obj [ key ] = flatOptions . userAgent
1981
+ process . env . npm_config_user_agent = flatOptions . userAgent
1973
1982
} ,
1974
1983
} )
1975
1984
0 commit comments