Skip to content

getPathValidationMessage

Validates every segment of a vault path with getFileNameValidationMessage.

Import:

import { getPathValidationMessage } from '@mnaoumov/obsidian-lib/validation';

Signature:

function getPathValidationMessage(path: string, isWindows: boolean | undefined, isAndroid: boolean | undefined): string

Parameters:

Parameter Type Description
path string The vault-relative path to validate, with / as the separator.
isWindows boolean | undefined Whether to use the Windows character set. Defaults to Platform.isWin.
isAndroid boolean | undefined Whether to use the Android character set when isWindows is false. Defaults to Platform.isAndroidApp.

Returns: string — The message for the first invalid segment, or an empty string if every segment is valid.