woocommerce/plugins/woocommerce-blocks/assets/js/base/context/cart-checkout/shipping/utils.js

17 lines
314 B
JavaScript

/**
* Internal dependencies
*/
import { shippingErrorCodes } from './constants';
export const hasInvalidShippingAddress = ( errors ) => {
return errors.some( ( error ) => {
if (
error.code &&
Object.values( shippingErrorCodes ).includes( error.code )
) {
return true;
}
return false;
} );
};