UNPKG

@amaui/utils

Version:
14 lines (11 loc) 318 B
import is from './is'; import setObjectValue from './setObjectValue'; const unflattenObject = object => { if (is('object', object)) { const output = {}; Object.keys(object).forEach(key => setObjectValue(output, key, object[key])); return output; } return object; }; export default unflattenObject;