The supplier's own shipping scope.
The requested shipping scope to satisfy.
True when supplierScope is equal to or broader than requested.
shippingCovers('worldwide', 'domestic'); // => true
shippingCovers('domestic', 'worldwide'); // => false
shippingCovers('domestic', 'local'); // => true
export function shippingCovers(supplierScope: ShippingRange, requested: ShippingRange): boolean {
return SHIPPING_SCOPE_RANK[supplierScope] >= SHIPPING_SCOPE_RANK[requested];
}
Whether a supplier's shipping scope fulfills a requested one, treating scope as a hierarchy: a scope covers itself and every narrower scope (worldwide covers all, local covers only local).