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