Created
July 5, 2021 10:42
-
-
Save lenconda/21992007f43dbbac6c07b63393551140 to your computer and use it in GitHub Desktop.
Dollie Examples
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
const _ = require('lodash'); | |
module.exports = async (id, config = {}) => { | |
if (!id) { | |
return null; | |
} | |
const [repository, checkout = ''] = id.split('@'); | |
const token = config.token || ''; | |
return { | |
url: `https://api.github.com/repos/${repository}/zipball${checkout ? `/${checkout}` : ''}`, | |
headers: token ? { | |
'Authorization': `token ${token}`, | |
} : {}, | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment