UNPKG

epic-p2p-shipping

Version:
20 lines (19 loc) 671 B
"use strict"; 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;