Function addTrailingSlash

Adds a trailing slash to the end of the segment (if it doesn't already exist)

const segment = addTrailingSlash('example');

console.log(segment); // 'example/'
  • Parameters

    • segment: string

    Returns string