mirror of
https://github.com/diligencia/semantic-branch-version.git
synced 2024-11-24 03:13:52 +08:00
13 lines
274 B
JavaScript
13 lines
274 B
JavaScript
|
export async function auth(token) {
|
||
|
const tokenType = token.split(/\./).length === 3
|
||
|
? "app"
|
||
|
: /^v\d+\./.test(token)
|
||
|
? "installation"
|
||
|
: "oauth";
|
||
|
return {
|
||
|
type: "token",
|
||
|
token: token,
|
||
|
tokenType
|
||
|
};
|
||
|
}
|