@unction/inflatetree v14.15.0
@unction/inflateTree
string => Record<string | number | symbol, B> | Map<A, B> => RecordType<A, C>
Takes a flat record with a specific key pattern and turns it into a nested record.
inflateTree(
"-"
)(
{
"data-profile-name": "Kurtis Rainbolt-Greene",
"data-profile-age": 24,
"data-metadata-interval": "10s",
"data-location": "http://api.example.com/profiles/24",
}
)
which returns
{
data: {
profile: {
name: "Kurtis Rainbolt-Greene",
age: 24,
},
metadata: {interval: "10s"},
location: "http://api.example.com/profiles/24",
},
}
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago