fix: formatting

This commit is contained in:
Tomasz Stefaniak 2025-09-11 12:37:48 -07:00
parent 2d518abf2b
commit ae9f87418d
2 changed files with 6 additions and 2 deletions

View file

@ -4,7 +4,9 @@ export function convertRuleBlockToSlashCommand(
rule: RuleWithSource,
): SlashCommandWithSource {
return {
name: rule.name || (rule.rule.length > 20 ? rule.rule.substring(0, 20) + "..." : rule.rule),
name:
rule.name ||
(rule.rule.length > 20 ? rule.rule.substring(0, 20) + "..." : rule.rule),
description: rule.description ?? "",
prompt: rule.rule,
source: "invokable-rule",

View file

@ -47,7 +47,9 @@ describe("convertRuleBlockToSlashCommand", () => {
const result = convertRuleBlockToSlashCommand(rule);
expect(result.name).toBe("This is a very long ...");
expect(result.prompt).toBe("This is a very long rule text that should be truncated");
expect(result.prompt).toBe(
"This is a very long rule text that should be truncated",
);
});
it("should handle a rule without description", () => {