npm i nestify-anything
Recreates an object from any nested.props
. A simple and small integration.
Can be used in combination with flatten-anything π, which does the exact opposite of this one! π
- is-what π
- is-where π
- merge-anything π₯‘
- check-anything π
- remove-anything βοΈ
- getorset-anything π
- map-anything πΊ
- filter-anything βοΈ
- copy-anything π
- case-anything π«
- flatten-anything π
- nestify-anything π§
import { nestifyObject } from 'nestify-anything'
const target = {
'name': 'Ho-oh',
'types.fire': true,
'types.flying': true,
}
nestifyObject(target)
// returns {
// name: 'Ho-oh',
// types: { fire: true, flying: true }
// }
Currently the library only works with the dot character '.'
as separator. If you need other characters like slash '/'
, let me know in an issue!