diff options
| author | Adam Malczewski <[email protected]> | 2026-03-28 01:47:12 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-03-28 01:47:12 +0900 |
| commit | 94bca96aec909890da7c06a03e5c2c6b380be4a8 (patch) | |
| tree | 4bbe68761f16f956fd48808919761e0625c97d93 /src/tools.ts | |
| parent | 7ecd929a1d6dbfbf61accdf7d4236a7005ea25e4 (diff) | |
| download | ai-pulse-obsidian-plugin-94bca96aec909890da7c06a03e5c2c6b380be4a8.tar.gz ai-pulse-obsidian-plugin-94bca96aec909890da7c06a03e5c2c6b380be4a8.zip | |
fix build errors and cleanup code
Diffstat (limited to 'src/tools.ts')
| -rw-r--r-- | src/tools.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools.ts b/src/tools.ts index 56236de..636d813 100644 --- a/src/tools.ts +++ b/src/tools.ts @@ -645,7 +645,7 @@ export const TOOL_REGISTRY: ToolEntry[] = [ } const lines = result.split("\n").filter((l) => l.length > 0); const moreMatch = result.match(/\.\.\.\s*and\s+(\d+)\s+more/); - const extraCount = moreMatch !== null ? parseInt(moreMatch[1], 10) : 0; + const extraCount = moreMatch !== null ? parseInt(moreMatch[1] ?? "0", 10) : 0; const count = lines.length - (moreMatch !== null ? 1 : 0) + extraCount; return `${count} result${count === 1 ? "" : "s"} found`; }, @@ -855,7 +855,7 @@ export const TOOL_REGISTRY: ToolEntry[] = [ } const lines = result.split("\n").filter((l) => l.length > 0 && !l.startsWith("...")); const cappedMatch = result.match(/results capped at (\d+)/); - const count = cappedMatch !== null ? `${cappedMatch[1]}+` : `${lines.length}`; + const count = cappedMatch !== null ? `${cappedMatch[1] ?? "?"}+` : `${lines.length}`; return `${count} match${lines.length === 1 ? "" : "es"} found`; }, definition: { |
