Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return Object.keys(obj).reduce((result, key) => {
let val = obj[key];
let keys = key.split(".");
let len = keys.length;
let lastKey = keys[len - 1];
set(result, keys.join("/"), fn(val, lastKey));
return result;
}, res);
}