Last active
March 9, 2017 20:00
-
-
Save trieloff/59560e2475c33da1ab0abc971c89e8a7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var github = { | |
isPublic: function(repo) { | |
return !repo.private; | |
}, | |
isOriginal: function(repo) { | |
return !repo.fork; | |
}, | |
licenseUrl: function(repo) { | |
return repo.contents_url.replace(/\{\+path\}/,"LICENSE"); | |
} | |
} | |
function main(params) { | |
github.token = params.token; | |
return github.getUser() | |
.then(github.getUserReposUrl) | |
.then(github.getUserRepos) | |
.filter(github.isPublic) | |
.filter(github.isOriginal) | |
.map(github.licenseUrl); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment