epic-p2p-shipping
Version:
A Point to Point Shipping calculation library.
20 lines (19 loc) • 671 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ShippingBranch = void 0;
class ShippingBranch {
constructor(name, Amounts) {
this.name = name;
this.Amounts = Amounts;
this.has = (node) => [...Object.keys(this.Amounts), this.name].includes(node);
this.getName = () => this.name;
this.getNodes = () => Object.keys(this.Amounts);
this.setAmount = (to, amount) => {
// @ts-ignore
this.Amounts[to] = amount;
return this;
};
this.getAmount = (to) => this.Amounts[to];
}
}
exports.ShippingBranch = ShippingBranch;