DictionaryService.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. var _Dictionary = _interopRequireDefault(require("../Inputs/Dictionary"));
  7. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  10. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  11. var Dictionary =
  12. /*#__PURE__*/
  13. function () {
  14. function Dictionary(data) {
  15. _classCallCheck(this, Dictionary);
  16. this.data = {};
  17. for (var i in data) {
  18. this.data[i.toLowerCase()] = data[i];
  19. }
  20. }
  21. _createClass(Dictionary, [{
  22. key: "get",
  23. value: function get(key) {
  24. return this.data[key.toLowerCase()] || key;
  25. }
  26. }]);
  27. return Dictionary;
  28. }();
  29. var _default = new Dictionary(_Dictionary.default);
  30. exports.default = _default;