First upload version 0.0.1
This commit is contained in:
38
node_modules/@octokit/auth-app/dist-src/requires-app-auth.js
generated
vendored
Normal file
38
node_modules/@octokit/auth-app/dist-src/requires-app-auth.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
const PATHS = [
|
||||
"/app",
|
||||
"/app/hook/config",
|
||||
"/app/hook/deliveries",
|
||||
"/app/hook/deliveries/{delivery_id}",
|
||||
"/app/hook/deliveries/{delivery_id}/attempts",
|
||||
"/app/installations",
|
||||
"/app/installations/{installation_id}",
|
||||
"/app/installations/{installation_id}/access_tokens",
|
||||
"/app/installations/{installation_id}/suspended",
|
||||
"/app/installation-requests",
|
||||
"/marketplace_listing/accounts/{account_id}",
|
||||
"/marketplace_listing/plan",
|
||||
"/marketplace_listing/plans",
|
||||
"/marketplace_listing/plans/{plan_id}/accounts",
|
||||
"/marketplace_listing/stubbed/accounts/{account_id}",
|
||||
"/marketplace_listing/stubbed/plan",
|
||||
"/marketplace_listing/stubbed/plans",
|
||||
"/marketplace_listing/stubbed/plans/{plan_id}/accounts",
|
||||
"/orgs/{org}/installation",
|
||||
"/repos/{owner}/{repo}/installation",
|
||||
"/users/{username}/installation",
|
||||
"/enterprises/{enterprise}/installation"
|
||||
];
|
||||
function routeMatcher(paths) {
|
||||
const regexes = paths.map(
|
||||
(p) => p.split("/").map((c) => c.startsWith("{") ? "(?:.+?)" : c).join("/")
|
||||
);
|
||||
const regex = `^(?:${regexes.map((r) => `(?:${r})`).join("|")})$`;
|
||||
return new RegExp(regex, "i");
|
||||
}
|
||||
const REGEX = routeMatcher(PATHS);
|
||||
function requiresAppAuth(url) {
|
||||
return !!url && REGEX.test(url.split("?")[0]);
|
||||
}
|
||||
export {
|
||||
requiresAppAuth
|
||||
};
|
||||
Reference in New Issue
Block a user