0.1.0 • Published 3 years ago
@headhr/lodash v0.1.0
Grithin's Lodash Enhancements
What
Various general use extensions I've written for lodash
Examples
Flattening Full Objects
_.flatten_to_input({bob:{sue:'bill'}})
//> {"bob[sue]":"bill"}
_.unflatten_input({"bob[sue]":"bill"})
//> {"bob":{"sue":"bill"}}
Flattening Selected Parts
_.flatten_parts_to_input({"bill":{"moe":"phil"},"bob":{"sue":"bill","mill":"jan"}}, ['bob'])
//> {"bill":{"moe":"phil"},"bob[sue]":"bill","bob[mill]":"jan"}
_.unflatten_input_parts({"bob[sue]":"bill", "bob[mill]":"jan", "bill[moe]":"phil"}, ['bob'])
//> {"bill[moe]":"phil","bob":{"sue":"bill","mill":"jan"}}
0.1.0
3 years ago