Move licenseCodes outside function

If this will be a separate file, we might as well.
This commit is contained in:
someguy126 2014-12-13 16:20:15 -08:00 committed by Thaddee Tyl
parent 9883d2bd19
commit c15ffb04f6

View File

@ -135,9 +135,6 @@ var githubLicense = function(user, repo, end) {
});
};
// Try to guess the license based on the text and return an abbreviated name (or null if not recognized).
var guessLicense = function(text) {
// Key phrases for common licenses
var licensePhrases = {
'Apache 1.1': 'apache (software)? license,? (version)? 1\\.1',
@ -167,6 +164,9 @@ var guessLicense = function(text) {
'CC0': 'cc0',
'Unlicense': 'this is free and unencumbered software released into the public domain',
}
// Try to guess the license based on the text and return an abbreviated name (or null if not recognized).
var guessLicense = function(text) {
var licenseCodes = Object.keys(licensePhrases);
var licenseRegex;
var spaceMetaRegex = new RegExp(' ', 'g');