MCPcopy
hub / github.com/graphif/project-graph / hasFileExtension

Function hasFileExtension

app/src/utils/pathString.tsx:273–277  ·  view source on GitHub ↗
(filename: string)

Source from the content-addressed store, hash-verified

271
272 // 辅助函数:判断字符串是否有文件扩展名
273 function hasFileExtension(filename: string): boolean {
274 if (!filename) return false;
275 // 简单的扩展名检测:包含点号且点号不在开头
276 return filename.includes(".") && filename.indexOf(".") > 0;
277 }
278
279 /**
280 * 检测一个字符串是否是一个有效的url网址

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected