refactor: centralize isPlainObject, isRecord, isErrno, isLoopbackHost utilities (#12926)

This commit is contained in:
max
2026-02-09 17:02:55 -08:00
committed by GitHub
parent 70f9edeec7
commit 8d75a496bf
37 changed files with 97 additions and 226 deletions

View File

@@ -1,4 +1,5 @@
import type { WebClient } from "@slack/web-api";
import { isRecord } from "../utils.js";
import { createSlackWebClient } from "./client.js";
export type SlackScopesResult = {
@@ -10,10 +11,6 @@ export type SlackScopesResult = {
type SlackScopesSource = "auth.scopes" | "apps.permissions.info";
function isRecord(value: unknown): value is Record<string, unknown> {
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
}
function collectScopes(value: unknown, into: string[]) {
if (!value) {
return;