Skip to content

normalizeIfRelative

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

Import:

import { normalizeIfRelative } from '@mnaoumov/typescript-lib/path';

Signature:

function normalizeIfRelative(path: string): string

Parameters:

Parameter Type Description
path string The path to normalize.

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