Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
export function isPdfPath(filePath: string): boolean {
const lastSlash = Math.max(filePath.lastIndexOf('/'), filePath.lastIndexOf('\\'));
const name = filePath.slice(lastSlash + 1);
const dot = name.lastIndexOf('.');
const ext = dot < 0 ? '' : name.slice(dot).toLowerCase();
return ext === '.pdf';
}