israel-postal-service-api
Advanced tools
Comparing version 3.0.0-beta.6 to 3.0.0-beta.7
@@ -91,3 +91,17 @@ import { OptionsType } from './types/options'; | ||
getAllDestinations(shipmentType: string): Array<string>; | ||
/** | ||
* verify if the shipment is eligible for economic shipment | ||
* @param {string} shipmentType type of shipment as defined in the {@class Options} class | ||
* @param {string} destination destination country name (in CamelCase English) | ||
* @returns {boolean} true, if the shipment is eligible for economic shipment, otherwise, false | ||
*/ | ||
isEligibleForExpressShipment(shipmentType: string, destination: string): boolean; | ||
/** | ||
* verify if the shipment is eligible for economic shipment | ||
* @param {string} shipmentType type of shipment as defined in the {@class Options} class | ||
* @param {string} destination destination country name (in CamelCase English) | ||
* @returns {boolean} true, if the shipment is eligible for economic shipment, otherwise, false | ||
*/ | ||
isEligibleForEconomicShipment(shipmentType: string, destination: string): boolean; | ||
private isLocalShipment; | ||
} |
@@ -138,2 +138,26 @@ "use strict"; | ||
} | ||
/** | ||
* verify if the shipment is eligible for economic shipment | ||
* @param {string} shipmentType type of shipment as defined in the {@class Options} class | ||
* @param {string} destination destination country name (in CamelCase English) | ||
* @returns {boolean} true, if the shipment is eligible for economic shipment, otherwise, false | ||
*/ | ||
isEligibleForExpressShipment(shipmentType, destination) { | ||
const abroadOptions = exports.Options.AbroadMailOptions; | ||
this.destinations._verifyDestinationMapLoaded(abroadOptions.EMS.shipmentType); | ||
return (shipmentType == abroadOptions.EMS.shipmentType || shipmentType == abroadOptions.PARCEL.shipmentType) | ||
&& this.destinations.emsDestinationMap.has(destination); | ||
} | ||
/** | ||
* verify if the shipment is eligible for economic shipment | ||
* @param {string} shipmentType type of shipment as defined in the {@class Options} class | ||
* @param {string} destination destination country name (in CamelCase English) | ||
* @returns {boolean} true, if the shipment is eligible for economic shipment, otherwise, false | ||
*/ | ||
isEligibleForEconomicShipment(shipmentType, destination) { | ||
const abroadOptions = exports.Options.AbroadMailOptions; | ||
this.destinations._verifyDestinationMapLoaded(abroadOptions.ECO.shipmentType); | ||
return (shipmentType == abroadOptions.ECO.shipmentType || shipmentType == abroadOptions.PARCEL.shipmentType) | ||
&& this.destinations.economicDestinationMap.has(destination); | ||
} | ||
isLocalShipment(destination) { | ||
@@ -140,0 +164,0 @@ return destination.toLowerCase() === 'israel'; |
{ | ||
"name": "israel-postal-service-api", | ||
"version": "3.0.0-beta.6", | ||
"version": "3.0.0-beta.7", | ||
"description": "Israel postal office pricing calculator", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
144200
1141