3
0
Fork 0
mirror of https://gitea.com/actions/setup-node.git synced 2024-11-28 13:09:32 +01:00
setup-node/node_modules/@octokit/rest/plugins/authentication/validate.js
2019-08-05 15:18:52 -04:00

21 lines
350 B
JavaScript

module.exports = validateAuth
function validateAuth (auth) {
if (typeof auth === 'string') {
return
}
if (typeof auth === 'function') {
return
}
if (auth.username && auth.password) {
return
}
if (auth.clientId && auth.clientSecret) {
return
}
throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`)
}