@hedhog/utils
Version:
<p align="center"> <img src="https://avatars.githubusercontent.com/u/177489127?s=200&v=4" alt="Hedhog Avatar" /> </p>
18 lines • 535 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.getLocalesFromItem = void 0;
const getLocalesFromItem = (item) => {
var _a;
if (item) {
const fields = [];
for (const itemLocale of (_a = item.locale) !== null && _a !== void 0 ? _a : []) {
fields.push(itemLocale.locale.code);
}
return [...new Set(fields)];
}
else {
return [];
}
};
exports.getLocalesFromItem = getLocalesFromItem;
//# sourceMappingURL=getLocalesFromItem.js.map
;