import unifyNestedLevel from "./unify-nested-level" ; const deepen = ( obj ) => { const result = { } ; const workObj = unifyNestedLevel ( obj ) ; for ( const objectPath in workObj ) { const parts = objectPath . split ( "-" ) ; let target = result ; while ( parts . length > 1 ) { const part = parts . shift ( ) ; target = target [ part ] = target [ part ] || { } ; } target [ parts [ 0 ] ] = workObj [ objectPath ] ; } return result ; } ; export default deepen ;