Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
isPermissive to cover more cases
Browse files Browse the repository at this point in the history
  • Loading branch information
igorklopov committed May 22, 2017
1 parent bb9b269 commit ef490ed
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/walker.js
Expand Up @@ -23,24 +23,25 @@ function shortFromAlias (alias) {

function isPermissive (config) {
if (config.private) return false;
let { license } = config;
let { license, licenses } = config;
if (!license && licenses) license = licenses[0];
if (typeof license === 'object') license = license.type;
if (!license) return false;
if (/^\(/.test(license)) license = license.slice(1);
if (/\)$/.test(license)) license = license.slice(0, -1);
license = license.toLowerCase();
const licenses = Array.prototype.concat(
licenses = Array.prototype.concat(
license.split(' or '), license.split(' and '),
license.split('/'), license.split(',')
);
let result = false;
const foss = [ 'isc', 'mit', 'apache-2.0', 'apache 2.0',
'public domain', 'bsd', 'bsd-2-clause', 'bsd-3-clause', 'wtfpl',
'cc-by-3.0', 'x11', 'artistic-2.0', 'gplv3', 'mplv2.0' ];
licenses.some(c => {
'cc-by-3.0', 'x11', 'artistic-2.0', 'gplv3', 'mpl', 'mplv2.0' ];
for (const c of licenses) {
result = foss.indexOf(c) >= 0;
return result;
});
if (result) break;
}
return result;
}

Expand Down

0 comments on commit ef490ed

Please sign in to comment.