Move licenseCodes outside function
If this will be a separate file, we might as well.
This commit is contained in:
parent
9883d2bd19
commit
c15ffb04f6
|
@ -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');
|
||||
|
|
Loading…
Reference in New Issue
Block a user