Function getQueryParams

  • Get all URL parameters (behind "#")

    Parameters

    • url: string

      pass in the url string

    Returns Record<string, string>

    • result
    getQueryParams('https://test.com?key1=100#/home?key1=200')
    // \{"key1":"200"\}

    getQueryParams('https://test.com?key1=100#/home?key1=200', true)
    // \{"key1":200\}

    getQueryParams(true)
    // \{"key1":200\}

    5.0.0

  • Get all URL parameters (behind "#")

    Parameters

    • url: boolean

      pass in the url string

    Returns Record<string, unknown>

    • result
    getQueryParams('https://test.com?key1=100#/home?key1=200')
    // \{"key1":"200"\}

    getQueryParams('https://test.com?key1=100#/home?key1=200', true)
    // \{"key1":200\}

    getQueryParams(true)
    // \{"key1":200\}

    5.0.0

  • Get all URL parameters (behind "#")

    Parameters

    • url: string

      pass in the url string

    • covert: boolean

      Converts a specific string to a corresponding value (Scientific notation, binary, octal and hexadecimal types of data are not converted, like: 0b111, 0o13, 0xFF, 1e3, -1e-2)

    Returns Record<string, unknown>

    • result
    getQueryParams('https://test.com?key1=100#/home?key1=200')
    // \{"key1":"200"\}

    getQueryParams('https://test.com?key1=100#/home?key1=200', true)
    // \{"key1":200\}

    getQueryParams(true)
    // \{"key1":200\}

    5.0.0