• Takes an object and serializes its keys and values into a query string. Only plain values and arrays of plain values are supported.

    Note: the returned string does not contain a leading "?"

    Parameters

    • object: Record<string, any> = {}

      holds query parameters

    Returns string

    the serialized query string

    import { objectToQuery } from "apprt-core/url-utils";
    const query = objectToQuery({
    a: 1,
    b: ["2", 3]
    });
    // query === "a=1&b=2&b=3"