All files / app/shipping hasSelectedShippingOptions.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 8 9 10 11 12 13  14x   14x 185x 96x     89x 117x      
import { Consignment } from '@bigcommerce/checkout-sdk';
import { every } from 'lodash';
 
export default function hasSelectedShippingOptions(consignments: Consignment[]): boolean {
    if (!consignments.length) {
        return false;
    }
 
    return every(consignments,
        consignment => consignment.selectedShippingOption && consignment.selectedShippingOption.id
    );
}