Adds a leading slash to the beginning of the segment (if it doesn't already exist)
const segment = addLeadingSlash('example');console.log(segment); // '/example' Copy
const segment = addLeadingSlash('example');console.log(segment); // '/example'
Adds a leading slash to the beginning of the segment (if it doesn't already exist)
Usage