Skip to content
This repository was archived by the owner on Aug 17, 2026. It is now read-only.

Latest commit

 

History

History

README.md

parse

Parses a query string into an object.

Type signature

(xs?: string) => {
    [index: string]: string | boolean;
}

Examples

parse("test&count=5");
// ⇒ { test: true, count: "5" }

Questions

  • How to parse a query string?

read

Parses the given query string into an object using URLSearchParams.

Type signature

(source: string) => Result

Examples

read("test&count=5");
// ⇒ { test: "", count: "5" }

Questions

  • How to parse a query string using URLSearchParams?

serialize

Serializes the given object into a query string.

Type signature

<T>(xs?: GenericObject<T>) => string

Examples

serialize({ test: true, value: "a string with spaces", missing: false });
// ⇒ "test&value=a%20string%20with%20spaces"

Questions

  • How to serialize an object to a query string?