UNPKG

@bitloops/bl-boilerplate-core

Version:

TypeScript boilerplate code for Bitloops Language generated projects

30 lines (29 loc) 1.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ISOShouldBeSupportedRule = exports.CurrencyShouldExistRule = void 0; const Currency_1 = require("../Currency"); const errors_1 = require("../errors"); class CurrencyShouldExistRule { constructor(currencyCode) { this.currencyCode = currencyCode; this.Error = new errors_1.CurrencyCodeDoesNotExistError(this.currencyCode); } isBrokenIf() { if (!Currency_1.ISO_4217_CURRENCY_CODES[this.currencyCode]) return true; return false; } } exports.CurrencyShouldExistRule = CurrencyShouldExistRule; class ISOShouldBeSupportedRule { constructor(standard) { this.standard = standard; this.Error = new errors_1.CurrencyStandardDoesNotExistError(this.standard); } isBrokenIf() { if (!Currency_1.AVAILABLE_CURRENCY_STANDARDS[this.standard]) return true; return false; } } exports.ISOShouldBeSupportedRule = ISOShouldBeSupportedRule;