GitHub

daffProductConfigurableEnsureChildren

Maps a list of products, ensuring that the configurable products have a list of child variant and attributes. If the list of incoming children is empty or nully, the children from state are intentionally used instead.

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