Skip to content

normalizeIfRelative

Normalizes a given path by ensuring it is relative, adding ”./” if necessary.

Import:

import { normalizeIfRelative } from 'obsidian-dev-utils/path';

Signature:

function normalizeIfRelative(path: string): string

Parameters:

ParameterTypeDescription
pathstringThe path to normalize.

Returns: string — The normalized path, starting with ”./” if it was relative.