Skip to content

Commit 501d96b

Browse files
ammarioammar-agent
authored andcommitted
make fmt
1 parent 1b9496b commit 501d96b

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

docs/instruction-files.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,11 @@ Example:
7979

8080
```markdown
8181
## Model: sonnet
82+
8283
Be terse and to the point.
8384

84-
## Model: openai:.*codex
85+
## Model: openai:.\*codex
86+
8587
Use status reporting tools every few minutes.
8688
```
8789

src/node/utils/main/markdown.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ import MarkdownIt from "markdown-it";
22

33
type HeadingMatcher = (headingText: string, level: number) => boolean;
44

5-
function extractSectionByHeading(
6-
markdown: string,
7-
headingMatcher: HeadingMatcher
8-
): string | null {
5+
function extractSectionByHeading(markdown: string, headingMatcher: HeadingMatcher): string | null {
96
if (!markdown) return null;
107

118
const md = new MarkdownIt({ html: false, linkify: false, typographer: false });
@@ -51,7 +48,10 @@ export function extractModeSection(markdown: string, mode: string): string | nul
5148
if (!markdown || !mode) return null;
5249

5350
const expectedHeading = `mode: ${mode}`.toLowerCase();
54-
return extractSectionByHeading(markdown, (headingText) => headingText.toLowerCase() === expectedHeading);
51+
return extractSectionByHeading(
52+
markdown,
53+
(headingText) => headingText.toLowerCase() === expectedHeading
54+
);
5555
}
5656

5757
/**
@@ -90,6 +90,6 @@ export function extractModelSection(markdown: string, modelId: string): string |
9090
const match = headingPattern.exec(headingText);
9191
if (!match) return false;
9292
const regex = compileRegex(match[1] ?? "");
93-
return Boolean(regex && regex.test(modelId));
93+
return Boolean(regex?.test(modelId));
9494
});
9595
}

0 commit comments

Comments
 (0)