13 lines
228 B
JavaScript
13 lines
228 B
JavaScript
|
function lowercaseKeys(object) {
|
||
|
if (!object) {
|
||
|
return {};
|
||
|
}
|
||
|
return Object.keys(object).reduce((newObj, key) => {
|
||
|
newObj[key.toLowerCase()] = object[key];
|
||
|
return newObj;
|
||
|
}, {});
|
||
|
}
|
||
|
export {
|
||
|
lowercaseKeys
|
||
|
};
|