Skip to content

hasWindowsTrailingChars

Checks whether a name ends with the dots or spaces Windows refuses.

Answers for Windows regardless of the platform in use: a vault is synced, so the rules that matter are not necessarily those of the machine asking.

Import:

import { hasWindowsTrailingChars } from 'obsidian-dev-utils/obsidian/validation';

Signature:

function hasWindowsTrailingChars(name: string): boolean

Parameters:

ParameterTypeDescription
namestringThe name to check. A single path segment, not a path.

Returns: booleantrue if the name ends with a dot or a space, false otherwise.