refactor: centralize bundle filtering with filterOutBundles helper
Some checks failed
Build and Deploy / build (push) Has been cancelled
Some checks failed
Build and Deploy / build (push) Has been cancelled
This commit is contained in:
@@ -35,4 +35,8 @@ export {
|
||||
getLocalizedProduct,
|
||||
parseDescription,
|
||||
getBundleProducts,
|
||||
getBundleProductsForProduct,
|
||||
getProductBundleComponents,
|
||||
isBundleProduct,
|
||||
filterOutBundles,
|
||||
} from "./products";
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user