change-string-case/node_modules/@octokit/auth-token/dist-src/auth.js

13 lines
274 B
JavaScript
Raw Normal View History

2022-11-04 00:55:07 +08:00
export async function auth(token) {
const tokenType = token.split(/\./).length === 3
? "app"
: /^v\d+\./.test(token)
? "installation"
: "oauth";
return {
type: "token",
token: token,
tokenType
};
}