summaryrefslogtreecommitdiffhomepage
path: root/src/tools.ts
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-03-28 01:47:12 +0900
committerAdam Malczewski <[email protected]>2026-03-28 01:47:12 +0900
commit94bca96aec909890da7c06a03e5c2c6b380be4a8 (patch)
tree4bbe68761f16f956fd48808919761e0625c97d93 /src/tools.ts
parent7ecd929a1d6dbfbf61accdf7d4236a7005ea25e4 (diff)
downloadai-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.ts4
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: {