Skip to content

Commit

Permalink
fix: handle incorrect licenses fields (#146)
Browse files Browse the repository at this point in the history
Co-authored-by: Justin Beckwith <[email protected]>
  • Loading branch information
syedsaadqamar and JustinBeckwith authored Apr 5, 2021
1 parent f02d5ed commit 209847f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,9 @@ export class LicenseChecker extends EventEmitter {
}
if (typeof license === 'string') return license;
if (Array.isArray(license)) {
if (license.length === 0) return null;
const types = license.map(x => x.type).filter(x => !!x);
return types.length === 1 ? types[0] : `(${types.join(' OR ')})`;
return types.length === 1 ? types[0] : `${types.join(' / ')}`;
}
return license.type || null;
}
Expand Down

0 comments on commit 209847f

Please sign in to comment.