GitHub

daffProductCompositeEnsureItems

Maps a list of products, ensuring that the composite products have a list of items. If the incoming items is empty or nully, the items from state are intentionally used instead.

import { daffProductCompositeEnsureItems } from '@daffodil/product-composite/state'
function daffProductCompositeEnsureItems<T extends DaffCompositeProduct = DaffCompositeProduct>(
  state: DaffProductReducersState<T>
  products: T[]
): T[]