@metreeca/qest - v0.9.1
    Preparing search index...

    Function encodeQuery

    • Encodes a query as a URL-safe string.

      Serializes a Query object into a string representation suitable for transmission as a URL query string in GET requests. The output format can be selected based on readability, compactness, and compatibility requirements.

      Parameters

      Returns string

      The encoded query string

      The "form" format always encodes to canonical form:

      • Operators use prefix notation (e.g., >=price=100)
      • String values are JSON double-quoted (e.g., name="widget")
      • Numbers, booleans, and null remain unquoted (JSON literals)
      • Sorting criteria are always numeric (e.g., ^price=1, ^name=-2)

      This ensures consistent, predictable output. The decoder accepts both canonical and shorthand forms (e.g., postfix operators like price>=100, unquoted strings like name=widget).