mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 00:20:22 +00:00
Refactor: trim duplicate gateway/onboarding helpers and dead utils (#43871)
* Gateway: share input provenance schema * Onboarding: dedupe top-level channel patching * Utils: remove unused path helpers * Protocol: refresh generated gateway models
This commit is contained in:
@@ -8,7 +8,6 @@ import {
|
||||
ensureDir,
|
||||
jidToE164,
|
||||
normalizeE164,
|
||||
normalizePath,
|
||||
resolveConfigDir,
|
||||
resolveHomeDir,
|
||||
resolveJidToE164,
|
||||
@@ -17,7 +16,6 @@ import {
|
||||
shortenHomePath,
|
||||
sleep,
|
||||
toWhatsappJid,
|
||||
withWhatsAppPrefix,
|
||||
} from "./utils.js";
|
||||
|
||||
function withTempDirSync<T>(prefix: string, run: (dir: string) => T): T {
|
||||
@@ -29,26 +27,6 @@ function withTempDirSync<T>(prefix: string, run: (dir: string) => T): T {
|
||||
}
|
||||
}
|
||||
|
||||
describe("normalizePath", () => {
|
||||
it("adds leading slash when missing", () => {
|
||||
expect(normalizePath("foo")).toBe("/foo");
|
||||
});
|
||||
|
||||
it("keeps existing slash", () => {
|
||||
expect(normalizePath("/bar")).toBe("/bar");
|
||||
});
|
||||
});
|
||||
|
||||
describe("withWhatsAppPrefix", () => {
|
||||
it("adds whatsapp prefix", () => {
|
||||
expect(withWhatsAppPrefix("+1555")).toBe("whatsapp:+1555");
|
||||
});
|
||||
|
||||
it("leaves prefixed intact", () => {
|
||||
expect(withWhatsAppPrefix("whatsapp:+1555")).toBe("whatsapp:+1555");
|
||||
});
|
||||
});
|
||||
|
||||
describe("ensureDir", () => {
|
||||
it("creates nested directory", async () => {
|
||||
await withTempDirSync("openclaw-test-", async (tmp) => {
|
||||
|
||||
Reference in New Issue
Block a user