UNPKG

icetool

Version:
25 lines (24 loc) 1.24 kB
"use strict"; var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); }; var _Errors_instances, _Errors_init; Object.defineProperty(exports, "__esModule", { value: true }); exports.Errors = void 0; const Console_1 = require("./Console"); const Translate_1 = require("./Translate"); class Errors { constructor(language = "us-US", type) { _Errors_instances.add(this); this.language = language; this.type = type; __classPrivateFieldGet(this, _Errors_instances, "m", _Errors_init).call(this); } } exports.Errors = Errors; _Errors_instances = new WeakSet(), _Errors_init = async function _Errors_init() { this.translate = new Translate_1.Translate(this.language).get(`errors.${this.type}`); throw Console_1.Console.error(this.translate); };