Skip to content

withLeadingSlash

Usage

js
import { withLeadingSlash } from '@studiometa/js-toolkit/utils';

withLeadingSlash('string'); // "/string"
withLeadingSlash('/string'); // "/string"

Parameters

  • string (string): The string to modify.

Return value

  • string: The modified string.

MIT Licensed