data-validations.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. "use strict";
  2. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3. 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); } }
  4. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  5. var DataValidations = /*#__PURE__*/function () {
  6. function DataValidations(model) {
  7. _classCallCheck(this, DataValidations);
  8. this.model = model || {};
  9. }
  10. _createClass(DataValidations, [{
  11. key: "add",
  12. value: function add(address, validation) {
  13. return this.model[address] = validation;
  14. }
  15. }, {
  16. key: "find",
  17. value: function find(address) {
  18. return this.model[address];
  19. }
  20. }, {
  21. key: "remove",
  22. value: function remove(address) {
  23. this.model[address] = undefined;
  24. }
  25. }]);
  26. return DataValidations;
  27. }();
  28. module.exports = DataValidations;
  29. //# sourceMappingURL=data-validations.js.map