wishthis/node_modules/@octokit/rest/plugins/authentication/validate.js
2022-01-21 09:28:41 +01:00

21 lines
355 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)}`);
}