@nlighten/json-transform-core
Version:
Core types and utilities for handling JSON transformers
61 lines (60 loc) • 1.38 kB
JSON
[
{
"name": "inline object to form",
"given": {
"input": {
"a": 1,
"b": "B",
"c": true
},
"definition": "$$form:$"
},
"expect": {
"equal": "a=1&b=B&c=true",
"format": "url-search-params"
}
},
{
"name": "inline object with array to form",
"given": {
"input": {
"a": [1, 2],
"c": true
},
"definition": "$$form:$"
},
"expect": {
"equal": "a=1&a=2&c=true",
"format": "url-search-params"
}
},
{
"name": "object object to form",
"given": {
"input": {
"a": 1,
"b": "B",
"c": true
},
"definition": { "$$form": "$" }
},
"expect": {
"equal": "a=1&b=B&c=true",
"format": "url-search-params"
}
},
{
"name": "object object with array to form",
"given": {
"input": {
"a": [1, 2],
"c": true
},
"definition": { "$$form": "$" }
},
"expect": {
"equal": "a=1&a=2&c=true",
"format": "url-search-params"
}
}
]