mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 12:20:26 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -71,7 +71,9 @@ export function mergeHookPresets(existing: string[] | undefined, preset: string)
|
||||
|
||||
export function normalizeHooksPath(raw?: string): string {
|
||||
const base = raw?.trim() || DEFAULT_HOOKS_PATH;
|
||||
if (base === "/") return DEFAULT_HOOKS_PATH;
|
||||
if (base === "/") {
|
||||
return DEFAULT_HOOKS_PATH;
|
||||
}
|
||||
const withSlash = base.startsWith("/") ? base : `/${base}`;
|
||||
return withSlash.replace(/\/+$/, "");
|
||||
}
|
||||
@@ -80,7 +82,9 @@ export function normalizeServePath(raw?: string): string {
|
||||
const base = raw?.trim() || DEFAULT_GMAIL_SERVE_PATH;
|
||||
// Tailscale funnel/serve strips the set-path prefix before proxying.
|
||||
// To accept requests at /<path> externally, gog must listen on "/".
|
||||
if (base === "/") return "/";
|
||||
if (base === "/") {
|
||||
return "/";
|
||||
}
|
||||
const withSlash = base.startsWith("/") ? base : `/${base}`;
|
||||
return withSlash.replace(/\/+$/, "");
|
||||
}
|
||||
@@ -253,7 +257,9 @@ export function buildTopicPath(projectId: string, topicName: string): string {
|
||||
|
||||
export function parseTopicPath(topic: string): { projectId: string; topicName: string } | null {
|
||||
const match = topic.trim().match(/^projects\/([^/]+)\/topics\/([^/]+)$/i);
|
||||
if (!match) return null;
|
||||
if (!match) {
|
||||
return null;
|
||||
}
|
||||
return { projectId: match[1] ?? "", topicName: match[2] ?? "" };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user