4
0
forked from crowetic/commerce
Belen Curcio 4784c06105 a11y pass
2020-10-25 11:00:34 -03:00

11 lines
348 B
TypeScript

import type { ProductNode } from '@lib/bigcommerce/api/operations/get-product'
export function getProductOptions(product: ProductNode) {
const options = product.productOptions.edges?.map(({ node }: any) => ({
displayName: node.displayName.toLowerCase(),
values: node.values.edges?.map(({ node }: any) => node),
}))
return options
}