@hedhog/utils
Version:
<p align="center"> <img src="https://avatars.githubusercontent.com/u/177489127?s=200&v=4" alt="Hedhog Avatar" /> </p>
22 lines • 742 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.getLocaleFields = void 0;
const getLocaleFields = (item) => {
var _a;
const fields = [];
for (const itemLocale of (_a = item.locale) !== null && _a !== void 0 ? _a : []) {
for (const key in itemLocale) {
if (key !== 'locale') {
fields.push({
fieldName: key,
fieldNameLocale: `${itemLocale.locale.code}-${key}`,
localeCode: itemLocale.locale.code,
value: itemLocale[key],
});
}
}
}
return fields;
};
exports.getLocaleFields = getLocaleFields;
//# sourceMappingURL=getLocaleFields.js.map
;