Files
klz-cables.com/.pnpm-store/v10/files/e6/032e5eb50f6142461ea6905442422d4e71b2ace34fb6d48cdd773b408153e2b3d591017088709c947ff5dc7ce01f1f7384e75de94d3f3e391f526b62da2017
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

23 lines
710 B
Plaintext

import ObjectIdImport from 'bson-objectid';
const ObjectId = 'default' in ObjectIdImport ? ObjectIdImport.default : ObjectIdImport;
export const isValidID = (value, type)=>{
if (type === 'text' && value) {
if ([
'object',
'string'
].includes(typeof value)) {
const isObjectID = ObjectId.isValid(value);
return typeof value === 'string' || isObjectID;
}
return false;
}
if (type === 'number' && typeof value === 'number' && !Number.isNaN(value)) {
return true;
}
if (type === 'ObjectID') {
return ObjectId.isValid(String(value));
}
return false;
};
//# sourceMappingURL=isValidID.js.map