Files
klz-cables.com/.pnpm-store/v10/files/9d/749ef293bacbd82841d3b19ae3d5e6fae043fe0f98fc63c3b340d443fc9b4c9bec68e78968a055b240091dbafb6b2acb0ceb6c7ea346e6dd644c1d498f67cd
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

18 lines
734 B
Plaintext

import { unflatten } from './unflatten.js';
export const getDataByPath = (fields, path)=>{
const pathPrefixToRemove = path.substring(0, path.lastIndexOf('.') + 1);
const name = path.split('.').pop();
const data = {};
Object.keys(fields).forEach((key)=>{
if (!fields[key]?.disableFormData && (key.indexOf(`${path}.`) === 0 || key === path)) {
data[key.replace(pathPrefixToRemove, '')] = fields[key]?.value;
if (fields[key]?.rows && fields[key].rows.length === 0) {
data[key.replace(pathPrefixToRemove, '')] = [];
}
}
});
const unflattenedData = unflatten(data);
return unflattenedData?.[name];
};
//# sourceMappingURL=getDataByPath.js.map