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"
Try in REPL

Questions

  • How to serialize an object to a query string?

TypeScript sourceJavaScript source