Simple helper method that add a leading slash / if not yet present.
/
import { addLeadingSlash } from '@helpers4/url'console.log(addLeadingSlash('your/path/without/leading/slash'))// => '/your/path/with/leading/slash'
var addLeadingSlash = require('@helpers4/url').addLeadingSlash;console.log(addLeadingSlash('your/path/without/leading/slash'))// => '/your/path/with/leading/slash'
a valid URL
Generated using TypeDoc
Simple helper method that add a leading slash
/
if not yet present.Example (es module)
Example (commonjs)