chore: Lint extensions folder.

This commit is contained in:
cpojer
2026-01-31 22:13:48 +09:00
parent 4f2166c503
commit 230ca789e2
221 changed files with 4006 additions and 1583 deletions

View File

@@ -16,7 +16,9 @@ export type ProbeMSTeamsResult = {
};
function readAccessToken(value: unknown): string | null {
if (typeof value === "string") return value;
if (typeof value === "string") {
return value;
}
if (value && typeof value === "object") {
const token =
(value as { accessToken?: unknown }).accessToken ?? (value as { token?: unknown }).token;
@@ -27,7 +29,9 @@ function readAccessToken(value: unknown): string | null {
function decodeJwtPayload(token: string): Record<string, unknown> | null {
const parts = token.split(".");
if (parts.length < 2) return null;
if (parts.length < 2) {
return null;
}
const payload = parts[1] ?? "";
const padded = payload.padEnd(payload.length + ((4 - (payload.length % 4)) % 4), "=");
const normalized = padded.replace(/-/g, "+").replace(/_/g, "/");
@@ -41,13 +45,17 @@ function decodeJwtPayload(token: string): Record<string, unknown> | null {
}
function readStringArray(value: unknown): string[] | undefined {
if (!Array.isArray(value)) return undefined;
if (!Array.isArray(value)) {
return undefined;
}
const out = value.map((entry) => String(entry).trim()).filter(Boolean);
return out.length > 0 ? out : undefined;
}
function readScopes(value: unknown): string[] | undefined {
if (typeof value !== "string") return undefined;
if (typeof value !== "string") {
return undefined;
}
const out = value
.split(/\s+/)
.map((entry) => entry.trim())