Function removeEndingSlash

  • Simple helper method that remove an ending slash / if present.

    Example (es module)

    import { removeEndingSlash } from '@helpers4/url'
    console.log(removeEndingSlash('https://www.google.com/'))
    // => 'https://www.google.com'

    Example (commonjs)

    var removeEndingSlash = require('@helpers4/url').removeEndingSlash;
    console.log(removeEndingSlash('https://www.google.com/'))
    // => 'https://www.google.com'

    Parameters

    • url: string

      a valid URL

    Returns string

Generated using TypeDoc