refactor: centralize bundle filtering with filterOutBundles helper
Some checks failed
Build and Deploy / build (push) Has been cancelled

This commit is contained in:
Unchained
2026-03-24 20:18:06 +02:00
parent bfce7dcca0
commit 3d8a77dafa
6 changed files with 18 additions and 19 deletions

View File

@@ -35,4 +35,8 @@ export {
getLocalizedProduct,
parseDescription,
getBundleProducts,
getBundleProductsForProduct,
getProductBundleComponents,
isBundleProduct,
filterOutBundles,
} from "./products";

View File

@@ -217,3 +217,7 @@ export function getProductBundleComponents(product: Product): number | null {
export function isBundleProduct(product: Product): boolean {
return getProductBundleComponents(product) !== null;
}
export function filterOutBundles(products: Product[]): Product[] {
return products.filter((product) => !isBundleProduct(product));
}