Skip to content

Instantly share code, notes, and snippets.

@lenconda
Created July 5, 2021 10:42
Show Gist options
  • Save lenconda/21992007f43dbbac6c07b63393551140 to your computer and use it in GitHub Desktop.
Save lenconda/21992007f43dbbac6c07b63393551140 to your computer and use it in GitHub Desktop.
Dollie Examples
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