Skip to content
This repository has been archived by the owner on Mar 13, 2021. It is now read-only.

Commit

Permalink
Fixed Linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Robertson committed Nov 12, 2020
1 parent 96a071f commit 84042d6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/core/test-app/utils/use-domestic-shipment-addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { buildAddressWithContactInfo } from "../factories/address";
export default function useDomesticShippingAddress(
deliveryService: DeliveryService,
): [AddressWithContactInfoPOJO | undefined, AddressWithContactInfoPOJO | undefined] {
let country: string | undefined = deliveryService.availableCountries.find(country => buildAddressWithContactInfo(`${country}-from`) && buildAddressWithContactInfo(`${country}-to`));
const country: string | undefined = deliveryService.availableCountries.find(country => buildAddressWithContactInfo(`${country}-from`) && buildAddressWithContactInfo(`${country}-to`));
return [
buildAddressWithContactInfo(`${country}-from`),
buildAddressWithContactInfo(`${country}-to`),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export default function useInternationalShipmentAddresses(
deliveryService: DeliveryService,
): [AddressWithContactInfoPOJO, AddressWithContactInfoPOJO] {
const allCountries = Object.values(Country);
let originCountryCode: string | undefined = deliveryService.availableCountries.find(country => buildAddressWithContactInfo(`${country}-from`));
let destinationCountryCode: string | undefined = allCountries.find(country => country !== originCountryCode && buildAddressWithContactInfo(`${country}-to`));
const originCountryCode: string | undefined = deliveryService.availableCountries.find(country => buildAddressWithContactInfo(`${country}-from`));
const destinationCountryCode: string | undefined = allCountries.find(country => country !== originCountryCode && buildAddressWithContactInfo(`${country}-to`));

if(!originCountryCode || !destinationCountryCode) {
throw new Error(`useInternationalShipmentAddresses error. Unable to find address in ${deliveryService.availableCountries}`);
Expand Down
5 changes: 2 additions & 3 deletions src/core/test-app/utils/use-shipment-addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ export default function useShipmentAddresses(deliveryService: DeliveryService):
if(deliveryService.serviceArea === ServiceArea.Global || deliveryService.serviceArea === ServiceArea.International) {
const internationalAddress = useInternationalShipmentAddresses(deliveryService);
return internationalAddress;
} else {
const domesticAddress = useDomesticShippingAddress(deliveryService);
return domesticAddress;
}
const domesticAddress = useDomesticShippingAddress(deliveryService);
return domesticAddress;
}

0 comments on commit 84042d6

Please sign in to comment.