Un-Flatten the given object. Given an object without nested elements, but whose keys represent paths in a nested elements object, return an object that has nested objects in it. This the reverse of flatten, in such a way that this complies.
unflatten({ 'a.a1': 1, 'a.a2': 2, 'b.b1.b1i': 'hello', 'b.b1.b1ii': 'world'});// this will yield:{ a: { a1: 1, a2: 2 }, b: { b1: { b1i: 'hello', b1ii: 'world' } }} Copy
unflatten({ 'a.a1': 1, 'a.a2': 2, 'b.b1.b1i': 'hello', 'b.b1.b1ii': 'world'});// this will yield:{ a: { a1: 1, a2: 2 }, b: { b1: { b1i: 'hello', b1ii: 'world' } }}
Additional options may be passed, such as which character is used as a delimiter, or the maximum depth level.
The element to unflatten.
Optional
The option to unflatten.
The unflattened object
Un-Flatten the given object. Given an object without nested elements, but whose keys represent paths in a nested elements object, return an object that has nested objects in it. This the reverse of flatten, in such a way that this complies.
Example
Additional options may be passed, such as which character is used as a delimiter, or the maximum depth level.