@hedhog/utils
Version:
<p align="center"> <img src="https://avatars.githubusercontent.com/u/177489127?s=200&v=4" alt="Hedhog Avatar" /> </p>
14 lines • 565 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.itemTranslations = void 0;
const itemTranslations = (translationKey, item) => {
var _a;
let locale = {};
if (item[translationKey] && ((_a = item[translationKey]) === null || _a === void 0 ? void 0 : _a.length) > 0) {
locale = Object.assign({}, item[translationKey][0]);
}
delete item[translationKey];
return Object.assign(Object.assign({}, item), locale);
};
exports.itemTranslations = itemTranslations;
//# sourceMappingURL=itemTranslations.js.map
;