fix: normalize gateway dev mode detection
This commit is contained in:
@@ -5,9 +5,7 @@ export type ChannelEntryMatch<T> = {
|
||||
wildcardKey?: string;
|
||||
};
|
||||
|
||||
export function buildChannelKeyCandidates(
|
||||
...keys: Array<string | undefined | null>
|
||||
): string[] {
|
||||
export function buildChannelKeyCandidates(...keys: Array<string | undefined | null>): string[] {
|
||||
const seen = new Set<string>();
|
||||
const candidates: string[] = [];
|
||||
for (const key of keys) {
|
||||
|
||||
@@ -24,10 +24,7 @@ import {
|
||||
} from "./config-helpers.js";
|
||||
import { resolveDiscordGroupRequireMention } from "./group-mentions.js";
|
||||
import { formatPairingApproveHint } from "./helpers.js";
|
||||
import {
|
||||
looksLikeDiscordTargetId,
|
||||
normalizeDiscordMessagingTarget,
|
||||
} from "./normalize/discord.js";
|
||||
import { looksLikeDiscordTargetId, normalizeDiscordMessagingTarget } from "./normalize/discord.js";
|
||||
import { discordOnboardingAdapter } from "./onboarding/discord.js";
|
||||
import { PAIRING_APPROVED_MESSAGE } from "./pairing-message.js";
|
||||
import {
|
||||
|
||||
@@ -18,10 +18,7 @@ import {
|
||||
} from "./config-helpers.js";
|
||||
import { formatPairingApproveHint } from "./helpers.js";
|
||||
import { resolveChannelMediaMaxBytes } from "./media-limits.js";
|
||||
import {
|
||||
looksLikeSignalTargetId,
|
||||
normalizeSignalMessagingTarget,
|
||||
} from "./normalize/signal.js";
|
||||
import { looksLikeSignalTargetId, normalizeSignalMessagingTarget } from "./normalize/signal.js";
|
||||
import { signalOnboardingAdapter } from "./onboarding/signal.js";
|
||||
import { PAIRING_APPROVED_MESSAGE } from "./pairing-message.js";
|
||||
import {
|
||||
|
||||
@@ -31,9 +31,9 @@ describe("requireTargetKind", () => {
|
||||
});
|
||||
|
||||
it("throws when the kind is missing or mismatched", () => {
|
||||
expect(() => requireTargetKind({ platform: "Slack", target: undefined, kind: "channel" })).toThrow(
|
||||
/Slack channel id is required/,
|
||||
);
|
||||
expect(() =>
|
||||
requireTargetKind({ platform: "Slack", target: undefined, kind: "channel" }),
|
||||
).toThrow(/Slack channel id is required/);
|
||||
const target = buildMessagingTarget("user", "U123", "U123");
|
||||
expect(() => requireTargetKind({ platform: "Slack", target, kind: "channel" })).toThrow(
|
||||
/Slack channel id is required/,
|
||||
|
||||
Reference in New Issue
Block a user