style: fix biome formatting
This commit is contained in:
@@ -657,10 +657,16 @@ export async function handleCommands(params: {
|
||||
};
|
||||
}
|
||||
const snapshot = await readConfigFileSnapshot();
|
||||
if (!snapshot.valid || !snapshot.parsed || typeof snapshot.parsed !== "object") {
|
||||
if (
|
||||
!snapshot.valid ||
|
||||
!snapshot.parsed ||
|
||||
typeof snapshot.parsed !== "object"
|
||||
) {
|
||||
return {
|
||||
shouldContinue: false,
|
||||
reply: { text: "⚠️ Config file is invalid; fix it before using /config." },
|
||||
reply: {
|
||||
text: "⚠️ Config file is invalid; fix it before using /config.",
|
||||
},
|
||||
};
|
||||
}
|
||||
const parsedBase = structuredClone(
|
||||
|
||||
@@ -5,7 +5,10 @@ import { parseConfigCommand } from "./config-commands.js";
|
||||
describe("parseConfigCommand", () => {
|
||||
it("parses show/unset", () => {
|
||||
expect(parseConfigCommand("/config")).toEqual({ action: "show" });
|
||||
expect(parseConfigCommand("/config show")).toEqual({ action: "show", path: undefined });
|
||||
expect(parseConfigCommand("/config show")).toEqual({
|
||||
action: "show",
|
||||
path: undefined,
|
||||
});
|
||||
expect(parseConfigCommand("/config show foo.bar")).toEqual({
|
||||
action: "show",
|
||||
path: "foo.bar",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
export function parseConfigValue(
|
||||
raw: string,
|
||||
): { value?: unknown; error?: string } {
|
||||
export function parseConfigValue(raw: string): {
|
||||
value?: unknown;
|
||||
error?: string;
|
||||
} {
|
||||
const trimmed = raw.trim();
|
||||
if (!trimmed) return { error: "Missing value." };
|
||||
|
||||
@@ -22,7 +23,7 @@ export function parseConfigValue(
|
||||
}
|
||||
|
||||
if (
|
||||
(trimmed.startsWith("\"") && trimmed.endsWith("\"")) ||
|
||||
(trimmed.startsWith('"') && trimmed.endsWith('"')) ||
|
||||
(trimmed.startsWith("'") && trimmed.endsWith("'"))
|
||||
) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user