Removes duplicated & non used code

This commit is contained in:
Filipa Lacerda 2018-03-09 16:49:43 +00:00
parent 92e119859d
commit 06cb160b43
No known key found for this signature in database
GPG key ID: 9CA3FDE4D1E2F1C8

View file

@ -65,20 +65,6 @@ export function capitalizeFirstCharacter(text) {
return `${text[0].toUpperCase()}${text.slice(1)}`;
}
export function camelCase(str) {
return str.replace(/_+([a-z])/gi, ($1, $2) => $2.toUpperCase());
}
export function camelCaseKeys(obj = {}) {
return Object.keys(obj).reduce((acc, key) => {
const camelKey = camelCase(key);
return {
...acc,
[camelKey]: obj[key],
};
}, {});
}
/**
* Replaces all html tags from a string with the given replacement.
*