@@ -69,7 +69,7 @@ pub struct NpmPackageLockfileInfo {
69
69
pub integrity : Option < String > ,
70
70
pub dependencies : Vec < NpmPackageDependencyLockfileInfo > ,
71
71
pub optional_dependencies : Vec < NpmPackageDependencyLockfileInfo > ,
72
- pub optional_peer_dependencies : Vec < NpmPackageDependencyLockfileInfo > ,
72
+ pub optional_peers : Vec < NpmPackageDependencyLockfileInfo > ,
73
73
pub os : Vec < SmallStackString > ,
74
74
pub cpu : Vec < SmallStackString > ,
75
75
pub tarball : Option < StackString > ,
@@ -93,7 +93,7 @@ pub struct NpmPackageInfo {
93
93
#[ serde( default ) ]
94
94
pub optional_dependencies : BTreeMap < StackString , StackString > ,
95
95
#[ serde( default ) ]
96
- pub optional_peer_dependencies : BTreeMap < StackString , StackString > ,
96
+ pub optional_peers : BTreeMap < StackString , StackString > ,
97
97
pub os : Vec < SmallStackString > ,
98
98
pub cpu : Vec < SmallStackString > ,
99
99
#[ serde( skip_serializing_if = "Option::is_none" ) ]
@@ -306,7 +306,7 @@ impl LockfileContent {
306
306
#[ serde( default ) ]
307
307
pub optional_dependencies : Vec < StackString > ,
308
308
#[ serde( default , skip_serializing_if = "Vec::is_empty" ) ]
309
- pub optional_peer_dependencies : Vec < StackString > ,
309
+ pub optional_peers : Vec < StackString > ,
310
310
#[ serde( default ) ]
311
311
pub os : Vec < SmallStackString > ,
312
312
#[ serde( default ) ]
@@ -378,7 +378,7 @@ impl LockfileContent {
378
378
BTreeMap :: new ( ) ;
379
379
let mut optional_dependencies =
380
380
BTreeMap :: < StackString , StackString > :: new ( ) ;
381
- let mut optional_peer_dependencies =
381
+ let mut optional_peers =
382
382
BTreeMap :: < StackString , StackString > :: new ( ) ;
383
383
384
384
for dep in value. dependencies . into_iter ( ) {
@@ -391,12 +391,8 @@ impl LockfileContent {
391
391
& mut optional_dependencies,
392
392
) ?;
393
393
}
394
- for dep in value. optional_peer_dependencies . into_iter ( ) {
395
- handle_dep (
396
- dep,
397
- & version_by_dep_name,
398
- & mut optional_peer_dependencies,
399
- ) ?;
394
+ for dep in value. optional_peers . into_iter ( ) {
395
+ handle_dep ( dep, & version_by_dep_name, & mut optional_peers) ?;
400
396
}
401
397
402
398
npm. insert (
@@ -408,7 +404,7 @@ impl LockfileContent {
408
404
os : value. os ,
409
405
tarball : value. tarball ,
410
406
optional_dependencies,
411
- optional_peer_dependencies ,
407
+ optional_peers ,
412
408
deprecated : value. deprecated ,
413
409
has_scripts : value. has_scripts ,
414
410
has_bin : value. has_bin ,
@@ -925,8 +921,8 @@ impl Lockfile {
925
921
. into_iter ( )
926
922
. map ( |dep| ( dep. name , dep. id ) )
927
923
. collect :: < BTreeMap < StackString , StackString > > ( ) ;
928
- let optional_peer_dependencies = package_info
929
- . optional_peer_dependencies
924
+ let optional_peers = package_info
925
+ . optional_peers
930
926
. into_iter ( )
931
927
. map ( |dep| ( dep. name , dep. id ) )
932
928
. collect :: < BTreeMap < StackString , StackString > > ( ) ;
@@ -936,7 +932,7 @@ impl Lockfile {
936
932
integrity : package_info. integrity ,
937
933
dependencies,
938
934
optional_dependencies,
939
- optional_peer_dependencies ,
935
+ optional_peers ,
940
936
os : package_info. os ,
941
937
cpu : package_info. cpu ,
942
938
tarball : package_info. tarball ,
@@ -1308,7 +1304,7 @@ mod tests {
1308
1304
integrity : Some ( "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==" . to_string ( ) ) ,
1309
1305
dependencies : vec ! [ ] ,
1310
1306
optional_dependencies : vec ! [ ] ,
1311
- optional_peer_dependencies : vec ! [ ] ,
1307
+ optional_peers : vec ! [ ] ,
1312
1308
os : vec ! [ ] ,
1313
1309
cpu : vec ! [ ] ,
1314
1310
tarball : None ,
@@ -1325,7 +1321,7 @@ mod tests {
1325
1321
integrity : Some ( "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" . to_string ( ) ) ,
1326
1322
dependencies : vec ! [ ] ,
1327
1323
optional_dependencies : vec ! [ ] ,
1328
- optional_peer_dependencies : vec ! [ ] ,
1324
+ optional_peers : vec ! [ ] ,
1329
1325
os : vec ! [ ] ,
1330
1326
cpu : vec ! [ ] ,
1331
1327
tarball : None ,
@@ -1342,7 +1338,7 @@ mod tests {
1342
1338
integrity : Some ( "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==" . to_string ( ) ) ,
1343
1339
dependencies : vec ! [ ] ,
1344
1340
optional_dependencies : vec ! [ ] ,
1345
- optional_peer_dependencies : vec ! [ ] ,
1341
+ optional_peers : vec ! [ ] ,
1346
1342
os : vec ! [ ] ,
1347
1343
cpu : vec ! [ ] ,
1348
1344
tarball : None ,
@@ -1364,7 +1360,7 @@ mod tests {
1364
1360
integrity : Some ( "sha512-foobar" . to_string ( ) ) ,
1365
1361
dependencies : vec ! [ ] ,
1366
1362
optional_dependencies : vec ! [ ] ,
1367
- optional_peer_dependencies : vec ! [ ] ,
1363
+ optional_peers : vec ! [ ] ,
1368
1364
os : vec ! [ ] ,
1369
1365
cpu : vec ! [ ] ,
1370
1366
tarball : None ,
0 commit comments