File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -448,10 +448,12 @@ function cleanup (data) {
448
448
}
449
449
450
450
const keys = Object . keys ( data )
451
+
451
452
if ( keys . length <= 3 && data . name && (
452
453
( keys . length === 1 ) ||
453
454
( keys . length === 3 && data . email && data . url ) ||
454
- ( keys . length === 2 && ( data . email || data . url ) )
455
+ ( keys . length === 2 && ( data . email || data . url ) ) ||
456
+ data . trustedPublisher
455
457
) ) {
456
458
data = unparsePerson ( data )
457
459
}
Original file line number Diff line number Diff line change @@ -126,6 +126,34 @@ const packument = (nv, opts) => {
126
126
'1.0.1' : { } ,
127
127
} ,
128
128
} ,
129
+ 'cyan-oidc' : {
130
+ _npmUser : {
131
+ name : 'claudia' ,
132
+ email : 'claudia@cyan.com' ,
133
+ trustedPublisher : {
134
+ id : 'github' ,
135
+ oidcConfigId : 'oidc:a0e127d0-8d66-45d0-8264-e4f8372c7249' ,
136
+ } ,
137
+ } ,
138
+ name : 'cyan' ,
139
+ 'dist-tags' : {
140
+ latest : '1.0.0' ,
141
+ } ,
142
+ versions : {
143
+ '1.0.0' : {
144
+ version : '1.0.0' ,
145
+ name : 'cyan' ,
146
+ dist : {
147
+ shasum : '123' ,
148
+ tarball : 'http://hm.cyan.com/1.0.0.tgz' ,
149
+ integrity : '---' ,
150
+ fileCount : 1 ,
151
+ unpackedSize : 1000000 ,
152
+ } ,
153
+ } ,
154
+ '1.0.1' : { } ,
155
+ } ,
156
+ } ,
129
157
brown : {
130
158
name : 'brown' ,
131
159
} ,
@@ -438,6 +466,12 @@ t.test('package with --json and semver range', async t => {
438
466
t . matchSnapshot ( joinedOutput ( ) )
439
467
} )
440
468
469
+ t . test ( 'package with _npmUser.trustedPublisher shows cleaned up property with --json' , async t => {
470
+ const { view, joinedOutput } = await loadMockNpm ( t , { config : { json : true } } )
471
+ await view . exec ( [ 'cyan-oidc@^1.0.0' ] )
472
+ t . match ( joinedOutput ( ) , / c l a u d i a < c l a u d i a @ c y a n .c o m > / , 'uses oidc trustedPublisher info for _npmUser' )
473
+ } )
474
+
441
475
t . test ( 'package with --json and no versions' , async t => {
442
476
const { view, joinedOutput } = await loadMockNpm ( t , { config : { json : true } } )
443
477
await view . exec ( [ 'brown' ] )
You can’t perform that action at this time.
0 commit comments