• Checks if a URL parameter exists and returns its value.
    Useful for debugging, feature flags, and configuration.

    Type Parameters

    • T extends string

    Parameters

    • paramName: T

      The URL parameter name to check

    Returns Param<T>

    • true if the parameter exists without a value (e.g. ?debug)
    • false if the parameter doesn't exist or is set to 0
    • The numeric value if it's a number (e.g. ?level=5 returns 5)
    • The string value otherwise (e.g. ?name=test returns "test")
    if (getParam("debug")) {
    console.log("Debug mode enabled");
    }
    const level = getParam("level"); // Returns number if ?level=5