Files
habitica/website/common/script/content/appearance/prefill.js
2024-04-02 17:58:06 -05:00

16 lines
304 B
JavaScript

import forOwn from 'lodash/forOwn';
import t from '../translation';
export default function prefillAppearances (obj) {
forOwn(obj, (value, key) => {
value.key = key;
if (!value.price) {
value.price = 0;
}
if (!value.text) {
value.text = t(key);
}
});
return obj;
}