habitica/website/common/script/content/appearance/prefill.js

16 lines
304 B
JavaScript
Raw Permalink Normal View History

import forOwn from 'lodash/forOwn';
import t from '../translation';
2019-10-01 15:53:48 +00:00
export default function prefillAppearances (obj) {
2019-10-08 14:57:10 +00:00
forOwn(obj, (value, key) => {
value.key = key;
if (!value.price) {
value.price = 0;
}
if (!value.text) {
value.text = t(key);
}
});
return obj;
2019-10-01 15:53:48 +00:00
}