Rebuild nested JSON objects and arrays from flat dot-notation keys.
The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.
Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.
Flat keys are split on the selected delimiter, numeric segments become array indexes, and each path is assigned into a new object or array. Later assignments can replace earlier values when paths collide.
{"user.name": "Alice", "user.address.city": "Portland", "active": true}
{
"user": {
"name": "Alice",
"address": {
"city": "Portland"
}
},
"active": true
}
Form maps, CSV path columns, and query-string objects use unflattening.