Function getFromQueryString

  • Get a specific key from the querystring. If you need multiple keys from the querystring, it's better to use getQueryStringAsObject instead.

    Parameters

    • key: string

      Name of the key to get

    • Optional defaultValue: any = undefined

      Value to return if the key does not exist or returns empty. (Default: undefined)

    Returns any

    Returns the value of the key, or the specified default value.

    Example

    import { url } from "@hboictcloud/api";

    //URL: profile.html?id=15
    const id = url.getFromQueryString("id");
    console.log(id); //15

Generated using TypeDoc