Skip to content

checkExtension

Checks if the given path or file has the specified extension.

Import:

import { checkExtension } from '@mnaoumov/obsidian-lib/file-system';

Signature:

function checkExtension(pathOrFile: PathOrAbstractFile | null, extension: string): boolean

Parameters:

Parameter Type Description
pathOrFile PathOrAbstractFile | null The path or abstract file to check.
extension string The extension to compare against.

Returns: boolean — Returns true if the path or file has the specified extension, false otherwise.