Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

Commit 209847f

Browse files
fix: handle incorrect licenses fields (#146)
Co-authored-by: Justin Beckwith <beckwith@google.com>
1 parent f02d5ed commit 209847f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/checker.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,9 @@ export class LicenseChecker extends EventEmitter {
190190
}
191191
if (typeof license === 'string') return license;
192192
if (Array.isArray(license)) {
193+
if (license.length === 0) return null;
193194
const types = license.map(x => x.type).filter(x => !!x);
194-
return types.length === 1 ? types[0] : `(${types.join(' OR ')})`;
195+
return types.length === 1 ? types[0] : `${types.join(' / ')}`;
195196
}
196197
return license.type || null;
197198
}

0 commit comments

Comments
 (0)