Files
klz-cables.com/.pnpm-store/v10/files/2f/9fea380bf5e23c70d90e655128888edf33b29fe381c52bb95ed36488f3bcf17440b199b090fe0b7e055bfaa13c7bc5720a8d9ee70768a047ef9ad81b99aea6
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
991 B
Plaintext

import { isNumber } from './isNumber.js';
/**
* Convert request JoinQuery object from strings to numbers
* @param joins
*/ export const sanitizeJoinParams = (_joins = {})=>{
const joinQuery = {};
const joins = _joins;
Object.keys(joins).forEach((schemaPath)=>{
if (joins[schemaPath] === 'false' || joins[schemaPath] === false) {
joinQuery[schemaPath] = false;
} else {
joinQuery[schemaPath] = {
count: joins[schemaPath].count === 'true',
limit: isNumber(joins[schemaPath]?.limit) ? Number(joins[schemaPath].limit) : undefined,
page: isNumber(joins[schemaPath]?.page) ? Number(joins[schemaPath].page) : undefined,
sort: joins[schemaPath]?.sort ? joins[schemaPath].sort : undefined,
where: joins[schemaPath]?.where ? joins[schemaPath].where : undefined
};
}
});
return joinQuery;
};
//# sourceMappingURL=sanitizeJoinParams.js.map