Skip to content

Latest commit

 

History

History
39 lines (24 loc) · 1016 Bytes

File metadata and controls

39 lines (24 loc) · 1016 Bytes

Function: lib.dom.form.arrayToQS

README -> API Index -> Modules Index -> lib.dom.form -> arrayToQS

Source Module: src/lib/dom/form/index.js Source Location: src/lib/dom/form/collectForm.js:159

Signature

arrayToQS(list, asArray = false)

Summary

Convert tuple list ([key, value]) into URL-encoded query-string parts.

Parameters

  • list: tuple list.
  • asArray: when true, returns array of key=value segments; otherwise joined string.

Behavior

  • Skips rows with nullish keys.
  • Encodes key and value with encodeURIComponent.
  • Nullish values become empty string values.

Returns

String query ("a=1&b=2") or array of segments.

Related