Skip to main content

$$formparse

Parses a Form URL-Encoded string to object

  • Every element will have 2 forms in the result object:
    • singular with its original query name (e.g. q)
    • plural with its name suffixed with $$ (e.g. q$$)

Usage​

{ 
"$$formparse": "..."
}
"$$formparse:{input}"

Returns​

object

Examples​

Input

Definition

Output

"a=1&b=B&c"
{ 
"$$formparse": "$"
}
{
"a": "1",
"a$$": ["1"],
"b": "B",
"b$$": ["B"],
"c": "true",
"c$$": ["true"]
}
"a=1&a=2"
{ 
"$$formparse": "$"
}
{
"a": "1",
"a$$": ["1", "2"]
}
"a=1&b=B&c"
"$$formparse:$"
{
"a": "1",
"a$$": ["1"],
"b": "B",
"b$$": ["B"],
"c": "true",
"c$$": ["true"]
}
"a=1&a=2"
"$$formparse:$"
{
"a": "1",
"a$$": ["1", "2"]
}