Files
klz-cables.com/.pnpm-store/v10/files/52/0e4f9c5f7519c7c57e3b782c9823c7cba840cffeb5408d3012b94cab91456f9261c64034d0abcfc12147a561e6037be876d5c8f17e6220cb1aaaffbbf0bc54
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

24 lines
935 B
Plaintext

import { unflatten as flatleyUnflatten } from './unflatten.js';
/**
* Reduce flattened form fields (Fields) to just map to the respective values instead of the full FormField object
*
* @param unflatten This also unflattens the data if `unflatten` is true. The unflattened data should match the original data structure
* @param ignoreDisableFormData - if true, will include fields that have `disableFormData` set to true, for example, blocks or arrays fields.
*
*/ export const reduceFieldsToValues = (fields, unflatten, ignoreDisableFormData)=>{
let data = {};
if (!fields) {
return data;
}
Object.keys(fields).forEach((key)=>{
if (ignoreDisableFormData === true || !fields[key]?.disableFormData) {
data[key] = fields[key]?.value;
}
});
if (unflatten) {
data = flatleyUnflatten(data);
}
return data;
};
//# sourceMappingURL=reduceFieldsToValues.js.map