Skip to content

Commit

Permalink
Change license shortcut for WTFPL
Browse files Browse the repository at this point in the history
See SPDX licenses for reference: https://spdx.org/licenses/

Also use Regex to match licenses
  • Loading branch information
Philipp Tusch committed Sep 9, 2015
1 parent 3e348db commit 83caa10
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/license.js
@@ -1,8 +1,11 @@
var MIT_LICENSE = /ermission is hereby granted, free of charge, to any/;
var BSD_LICENSE = /edistribution and use in source and binary forms, with or withou/;
var WTFPL_LICENSE = /DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE/;
var MIT = /MIT\b/;
var BSD = /BSD\b/;
var APACHE = /Apache License\b/;
var WTFPL = /WTFPL\b/;


module.exports = function(str) {
if (str) {
Expand All @@ -14,14 +17,16 @@ module.exports = function(str) {
return 'MIT*';
} else if (BSD_LICENSE.test(str)) {
return 'BSD*';
} else if (WTFPL_LICENSE.test(str)) {
return 'WTFPL*';
} else if (MIT.test(str)) {
return 'MIT*';
} else if (BSD.test(str)) {
return 'BSD*';
} else if (WTFPL.test(str)) {
return 'WTFPL*';
} else if (APACHE.test(str)) {
return 'Apache*';
} else if (str.indexOf('DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE') > -1 || str.indexOf('WTFPL') > -1) {
return 'WTF*';
}
return null;
};

0 comments on commit 83caa10

Please sign in to comment.