mcf-objects/dist/mcf-objects.js

2 lines
7.6 KiB
JavaScript
Raw Normal View History

2020-10-05 15:44:23 +01:00
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.mcfObjects=e():t.mcfObjects=e()}(window,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&o(t,e)}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=c(t);if(e){var r=c(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return u(this,n)}}function u(t,e){return!e||"object"!==i(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function c(t){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function l(t,e,n){return e&&s(t.prototype,e),n&&s(t,n),t}n.r(e),n.d(e,"definedObject",(function(){return g})),n.d(e,"mcfFile",(function(){return x}));var h=function(){function t(e){f(this,t),this.definition=e,this.validations={}}return l(t,[{key:"setValue",value:function(t){this.validate(t),this.value=t}},{key:"getValue",value:function(){return this.value}},{key:"validate",value:function(t){for(var e in this.validations)this.validations[e](t,this.definition)}}]),t}(),d=function(t){r(n,t);var e=a(n);function n(t){var i;return f(this,n),(i=e.call(this,t)).addValidations(),i}return l(n,[{key:"addValidations",value:function(){for(var t in this.validations.type=function(t){if("string"!=typeof t)throw new Error("MCF_String creation: the type of ".concat(t,' isn\'t "string"'))},this.definition)switch(t){case"maxLength":this.validations.maxLength=function(t,e){if(t.length>e.maxLength)throw new Error('MCF_String creation: the length of the string "'.concat(t,'" is higher than the maximum defined: ').concat(e.maxLength))};break;case"minLength":this.validations.minLength=function(t,e){if(t.length<e.minLength)throw new Error('MCF_String creation: the length of the string "'.concat(t,'" is lower than the minimum defined: ').concat(e.minLength))}}}}]),n}(h),v=function(t){r(n,t);var e=a(n);function n(t){var i;return f(this,n),(i=e.call(this,t)).addValidations(),i}ret
2020-03-16 23:25:54 +01:00
//# sourceMappingURL=mcf-objects.js.map