All files / app/shipping getLineItemsCount.ts

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7  16x   16x 80x    
import { LineItem } from '@bigcommerce/checkout-sdk';
import { reduce } from 'lodash';
 
export default function getLineItemsCount(lineItems: LineItem[]): number {
    return reduce(lineItems, (total, item) => total + item.quantity, 0);
}