MCPcopy
hub / github.com/marktext/marktext / isImageFile

Function isImageFile

packages/desktop/src/common/filesystem/paths.ts:46–49  ·  view source on GitHub ↗
(filepath: string)

Source from the content-addressed store, hash-verified

44 * Returns true if the path is an image file.
45 */
46export const isImageFile = (filepath: string): boolean => {
47 const ext = path.extname(filepath).slice(1).toLowerCase()
48 return !!ext && IMAGE_EXTENSIONS.includes(ext) && isFile(filepath)
49}
50
51/**
52 * Returns true if the path is a markdown file or symbolic link to one.

Callers 2

registerPathHandlersFunction · 0.90
registerUploaderHandlersFunction · 0.90

Calls 2

isFileFunction · 0.90
extnameMethod · 0.80

Tested by

no test coverage detected