mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 10:21:24 +00:00
refactor: centralize isPlainObject, isRecord, isErrno, isLoopbackHost utilities (#12926)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user