File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -18,14 +18,23 @@ const getLicenseContents = dependencyPath => {
1818 return licensePath && wrap ( readFileSync ( licensePath ) . toString ( ) , licenseWrap ) ;
1919} ;
2020
21+ const getLicenseName = package => {
22+ if ( package . licenses ) {
23+ const licenseName = package . licenses . map ( license => license . type ) . join ( " OR " ) ;
24+ return package . licenses . length > 1 ? `(${ licenseName } )` : licenseName ;
25+ }
26+
27+ return package . license ;
28+ }
29+
2130const getLicenseInformationForDependency = dependencyPath => {
2231 const package = require ( `${ dependencyPath } /package.json` ) ;
2332 return {
2433 name : package . name ,
2534 version : package . version ,
2635 author : ( package . author && package . author . name ) || package . author ,
2736 repository : ( package . repository && package . repository . url ) || package . repository ,
28- licenseName : package . license ,
37+ licenseName : getLicenseName ( package ) ,
2938 licenseText : getLicenseContents ( dependencyPath )
3039 } ;
3140} ;
You can’t perform that action at this time.
0 commit comments