diff --git a/bin/es5/AssertJS/Assert.js b/bin/es5/AssertJS/Assert.js index 9049c4d..4e9eb6d 100644 --- a/bin/es5/AssertJS/Assert.js +++ b/bin/es5/AssertJS/Assert.js @@ -683,7 +683,7 @@ var Assert = function () { this.string(urlValue); this.string(message, "Custom error message passed to Assert.url needs to be a valid string."); - var regexp = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,}))\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/i; + var regexp = /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[\-;:&=\+\$,\w]+@)?[A-Za-z0-9\.\-]+|(?:www\.|[\-;:&=\+\$,\w]+@)[A-Za-z0-9\.\-]+)((?:\/[\+~%\/\.\w\-_]*)?\??(?:[\-\+=&;%@\.\w_]*)#?(?:[\.\!\/\\\w]*))?)/; if (!regexp.test(urlValue)) { throw InvalidValueException.expected("valid url", urlValue, message); diff --git a/bin/es5/assert-js.min.js b/bin/es5/assert-js.min.js index 1d9f5c2..fecd5ee 100644 --- a/bin/es5/assert-js.min.js +++ b/bin/es5/assert-js.min.js @@ -1 +1 @@ -!function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";var n=r(1);e.exports=n,"undefined"!=typeof window&&(window.Assert=n)},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:"";if(this.string(r,"Custom error message passed to Assert.instanceOf needs to be a valid string."),"object"!==("undefined"==typeof e?"undefined":o(e)))throw s.expected("object",e,r);if(!(e instanceof t))throw s.expected(t.name,e,r.length?r:'Expected instance of "${expected}" but got "${received}".')}},{key:"instanceOneOf",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";this.string(r,"Custom error message passed to Assert.instanceOf needs to be a valid string."),this.array(t);var n=t.find(function(t){return e instanceof t});if(void 0===n)throw s.expected(t.map(function(e){return a.toString(e)}).join(", "),e,r.length?r:'Expected instance of "${expected}" but got "${received}".')}},{key:"integer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(this.string(t,"Custom error message passed to Assert.integer needs to be a valid string."),!Number.isInteger(e))throw s.expected("integer",e,t)}},{key:"number",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(this.string(t,"Custom error message passed to Assert.number needs to be a valid string."),"number"!=typeof e)throw s.expected("number",e)}},{key:"string",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("string"!=typeof t)throw"Custom error message passed to Assert.string needs to be a valid string.";if("string"!=typeof e)throw s.expected("string",e,t)}},{key:"boolean",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(this.string(t,"Custom error message passed to Assert.boolean needs to be a valid string."),"boolean"!=typeof e)throw s.expected("boolean",e,t)}},{key:"true",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(this["boolean"](e),this.string(t,"Custom error message passed to Assert.true needs to be a valid string."),e!==!0)throw s.expected("true",e,t)}},{key:"false",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(this["boolean"](e),this.string(t,"Custom error message passed to Assert.false needs to be a valid string."),e!==!1)throw s.expected("false",e,t)}},{key:"object",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(this.string(t,"Custom error message passed to Assert.object needs to be a valid string."),"object"!==("undefined"==typeof e?"undefined":o(e)))throw s.expected("object",e,t)}},{key:"hasFunction",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.string(e),this.object(t),this.string(r,"Custom error message passed to Assert.hasFunction needs to be a valid string."),"function"!=typeof t[e])throw s.expected('object to has function "'+e+'"',t,r)}},{key:"hasProperty",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.string(e),this.object(t),this.string(r,"Custom error message passed to Assert.hasProperty needs to be a valid string."),"undefined"==typeof t[e])throw s.expected('object to has property "'+e+'"',t,r)}},{key:"hasProperties",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";this.object(t),this.containsOnlyString(e),this.string(r,"Custom error message passed to Assert.hasProperties needs to be a valid string."),e.map(function(n){if("undefined"==typeof t[n])throw s.expected('object to has properties "'+e.join(", ")+'"',t,r)})}},{key:"array",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(this.string(t,"Custom error message passed to Assert.array needs to be a valid string."),!Array.isArray(e))throw s.expected("array",e,t)}},{key:"oneOf",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";this.string(r,"Custom error message passed to Assert.array needs to be a valid string."),this.array(t);var n=t.find(function(t){return e===t});if(void 0===n)throw s.expected(t.map(function(e){return a.toString(e)}).join(", "),e,r.length?r:'Expected one of "${expected}" but got "${received}".')}},{key:"isFunction",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(this.string(t,"Custom error message passed to Assert.isFunction needs to be a valid string."),"function"!=typeof e)throw s.expected("function",e,t)}},{key:"greaterThan",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.number(e),this.number(t),this.string(r,"Custom error message passed to Assert.greaterThan needs to be a valid string."),e>=t)throw r.length>0?r:"Expected value "+t+" to be greater than "+e}},{key:"greaterThanOrEqual",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.number(e),this.number(t),this.string(r,"Custom error message passed to Assert.greaterThanOrEqual needs to be a valid string."),e>t)throw r.length>0?r:"Expected value "+t+" to be greater than "+e+" or equal"}},{key:"lessThan",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.number(e),this.number(t),this.string(r,"Custom error message passed to Assert.lessThan needs to be a valid string."),t>=e)throw r.length>0?r:"Expected value "+t+" to be less than "+e}},{key:"lessThanOrEqual",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.number(e),this.number(t),this.string(r,"Custom error message passed to Assert.lessThanOrEqual needs to be a valid string."),t>e)throw r.length>0?r:"Expected value "+t+" to be less than "+e+" or equal"}},{key:"containsOnly",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";this.array(e,'Assert.containsOnly require valid array, got "${received}".'),this.string(r,"Custom error message passed to Assert.containsOnly needs to be a valid string.");var n=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done);n=!0){var l=a.value;try{this.instanceOf(l,t,r)}catch(f){throw s.expected(t.name,l,r.length?r:'Expected instance of "${expected}" but got "${received}".')}}}catch(d){o=!0,i=d}finally{try{!n&&u["return"]&&u["return"]()}finally{if(o)throw i}}}},{key:"containsOnlyString",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.array(e,'Assert.containsOnlyString require valid array, got "${received}".'),this.string(t,"Custom error message passed to Assert.containsOnly needs to be a valid string.");var r=!0,n=!1,o=void 0;try{for(var i,u=e[Symbol.iterator]();!(r=(i=u.next()).done);r=!0){var l=i.value;try{this.string(l,t)}catch(f){throw s.expected("string",e.map(function(e){return a.toString(e)}).join(", "),t.length?t:'Expected array of "${expected}" but got "${received}".')}}}catch(d){n=!0,o=d}finally{try{!r&&u["return"]&&u["return"]()}finally{if(n)throw o}}}},{key:"containsOnlyInteger",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.array(e,'Assert.containsOnlyInteger require valid array, got "${received}".'),this.string(t,"Custom error message passed to Assert.containsOnly needs to be a valid string.");var r=!0,n=!1,o=void 0;try{for(var i,u=e[Symbol.iterator]();!(r=(i=u.next()).done);r=!0){var l=i.value;try{this.integer(l,t)}catch(f){throw s.expected("integer",e.map(function(e){return a.toString(e)}).join(", "),t.length?t:'Expected array of "${expected}" but got "${received}".')}}}catch(d){n=!0,o=d}finally{try{!r&&u["return"]&&u["return"]()}finally{if(n)throw o}}}},{key:"containsOnlyNumber",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.array(e,'Assert.containsOnlyNumber require valid array, got "${received}".'),this.string(t,"Custom error message passed to Assert.containsOnly needs to be a valid string.");var r=!0,n=!1,o=void 0;try{for(var i,u=e[Symbol.iterator]();!(r=(i=u.next()).done);r=!0){var l=i.value;try{this.number(l,t)}catch(f){throw s.expected("number",e.map(function(e){return a.toString(e)}).join(", "),t.length?t:'Expected array of "${expected}" but got "${received}".')}}}catch(d){n=!0,o=d}finally{try{!r&&u["return"]&&u["return"]()}finally{if(n)throw o}}}},{key:"count",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.integer(e),this.array(t),this.string(r,"Custom error message passed to Assert.count needs to be a valid string."),t.length!==e)throw r.length?r:"Expected count "+e+", got "+t.length}},{key:"notEmpty",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(this.string(t,"Custom error message passed to Assert.empty needs to be a valid string."),0===e.length)throw s.expected("not empty value",e,t)}},{key:"oddNumber",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(this.integer(e),this.string(t,"Custom error message passed to Assert.oddNumber needs to be a valid string."),e%2!==1)throw s.expected("odd number",e,t)}},{key:"evenNumber",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(this.integer(e),this.string(t,"Custom error message passed to Assert.evenNumber needs to be a valid string."),e%2!==0)throw s.expected("even number",e,t)}},{key:"jsonString",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.string(e),this.string(t,"Custom error message passed to Assert.jsonString needs to be a valid string.");try{JSON.parse(e)}catch(r){throw s.expected("json string",e,t)}}},{key:"email",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.string(e),this.string(t,"Custom error message passed to Assert.email needs to be a valid string.");var r=/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i;if(!r.test(e))throw s.expected("valid email address",e,t)}},{key:"url",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.string(e),this.string(t,"Custom error message passed to Assert.url needs to be a valid string.");var r=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,}))\.?)(?::\d{2,5})?(?:[\/?#]\S*)?$/i;if(!r.test(e))throw s.expected("valid url",e,t)}},{key:"uuid",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.string(e),this.string(t,"Custom error message passed to Assert.uuid needs to be a valid string.");var r=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;if(!r.test(e))throw s.expected("valid uuid",e,t)}},{key:"hasElement",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.string(e),this.instanceOneOf(t,[HTMLElement,HTMLDocument]),this.string(r,"Custom error message passed to Assert.hasProperty needs to be a valid string."),null===t.querySelector(e))throw s.expected('html element to has element under selector "'+e+'"',t.outerHTML,r)}},{key:"hasAttribute",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";this.string(e),this.instanceOf(t,HTMLElement),this.string(r,"Custom error message passed to Assert.hasAttribute needs to be a valid string.");var n=t.getAttribute(e);if(null===n)throw s.expected('html element with attribute "'+e+'"',t.outerHTML,r)}},{key:"hasAttributes",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";this.containsOnlyString(e),this.instanceOf(t,HTMLElement),this.string(n,"Custom error message passed to Assert.hasAttributes needs to be a valid string."),e.map(function(o){try{r.hasAttribute(o,t)}catch(i){throw s.expected('html element with attributes "'+e.join(", ")+'"',t.outerHTML,n)}})}}]),e}();e.exports=u},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:"";if("string"!=typeof r)throw new Error('Expected string but got "'+s.toString(r)+'".');return r.length?new Error(i.create(r,{expected:e,received:s.toString(t)})):new Error("Expected "+e+' but got "'+s.toString(t)+'".')}}]),e}();e.exports=a},function(e,t){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof e)throw new Error('Expected string but got "'+ValueConverter.toString(e)+'".');if("object"!==("undefined"==typeof t?"undefined":n(t)))throw new Error('Expected string but got "'+ValueConverter.toString(t)+'".');return e.replace(i,function(e,r){return t.hasOwnProperty(r)?t[r]:e})}}]),e}();e.exports=s},function(e,t){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:"";if(this.string(r,"Custom error message passed to Assert.instanceOf needs to be a valid string."),"object"!==("undefined"==typeof e?"undefined":o(e)))throw s.expected("object",e,r);if(!(e instanceof t))throw s.expected(t.name,e,r.length?r:'Expected instance of "${expected}" but got "${received}".')}},{key:"instanceOneOf",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";this.string(r,"Custom error message passed to Assert.instanceOf needs to be a valid string."),this.array(t);var n=t.find(function(t){return e instanceof t});if(void 0===n)throw s.expected(t.map(function(e){return a.toString(e)}).join(", "),e,r.length?r:'Expected instance of "${expected}" but got "${received}".')}},{key:"integer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(this.string(t,"Custom error message passed to Assert.integer needs to be a valid string."),!Number.isInteger(e))throw s.expected("integer",e,t)}},{key:"number",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(this.string(t,"Custom error message passed to Assert.number needs to be a valid string."),"number"!=typeof e)throw s.expected("number",e)}},{key:"string",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("string"!=typeof t)throw"Custom error message passed to Assert.string needs to be a valid string.";if("string"!=typeof e)throw s.expected("string",e,t)}},{key:"boolean",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(this.string(t,"Custom error message passed to Assert.boolean needs to be a valid string."),"boolean"!=typeof e)throw s.expected("boolean",e,t)}},{key:"true",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(this.boolean(e),this.string(t,"Custom error message passed to Assert.true needs to be a valid string."),e!==!0)throw s.expected("true",e,t)}},{key:"false",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(this.boolean(e),this.string(t,"Custom error message passed to Assert.false needs to be a valid string."),e!==!1)throw s.expected("false",e,t)}},{key:"object",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(this.string(t,"Custom error message passed to Assert.object needs to be a valid string."),"object"!==("undefined"==typeof e?"undefined":o(e)))throw s.expected("object",e,t)}},{key:"hasFunction",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.string(e),this.object(t),this.string(r,"Custom error message passed to Assert.hasFunction needs to be a valid string."),"function"!=typeof t[e])throw s.expected('object to has function "'+e+'"',t,r)}},{key:"hasProperty",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.string(e),this.object(t),this.string(r,"Custom error message passed to Assert.hasProperty needs to be a valid string."),"undefined"==typeof t[e])throw s.expected('object to has property "'+e+'"',t,r)}},{key:"hasProperties",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";this.object(t),this.containsOnlyString(e),this.string(r,"Custom error message passed to Assert.hasProperties needs to be a valid string."),e.map(function(n){if("undefined"==typeof t[n])throw s.expected('object to has properties "'+e.join(", ")+'"',t,r)})}},{key:"array",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(this.string(t,"Custom error message passed to Assert.array needs to be a valid string."),!Array.isArray(e))throw s.expected("array",e,t)}},{key:"oneOf",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";this.string(r,"Custom error message passed to Assert.array needs to be a valid string."),this.array(t);var n=t.find(function(t){return e===t});if(void 0===n)throw s.expected(t.map(function(e){return a.toString(e)}).join(", "),e,r.length?r:'Expected one of "${expected}" but got "${received}".')}},{key:"isFunction",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(this.string(t,"Custom error message passed to Assert.isFunction needs to be a valid string."),"function"!=typeof e)throw s.expected("function",e,t)}},{key:"greaterThan",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.number(e),this.number(t),this.string(r,"Custom error message passed to Assert.greaterThan needs to be a valid string."),t<=e)throw r.length>0?r:"Expected value "+t+" to be greater than "+e}},{key:"greaterThanOrEqual",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.number(e),this.number(t),this.string(r,"Custom error message passed to Assert.greaterThanOrEqual needs to be a valid string."),t0?r:"Expected value "+t+" to be greater than "+e+" or equal"}},{key:"lessThan",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.number(e),this.number(t),this.string(r,"Custom error message passed to Assert.lessThan needs to be a valid string."),t>=e)throw r.length>0?r:"Expected value "+t+" to be less than "+e}},{key:"lessThanOrEqual",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.number(e),this.number(t),this.string(r,"Custom error message passed to Assert.lessThanOrEqual needs to be a valid string."),t>e)throw r.length>0?r:"Expected value "+t+" to be less than "+e+" or equal"}},{key:"containsOnly",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";this.array(e,'Assert.containsOnly require valid array, got "${received}".'),this.string(r,"Custom error message passed to Assert.containsOnly needs to be a valid string.");var n=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done);n=!0){var l=a.value;try{this.instanceOf(l,t,r)}catch(e){throw s.expected(t.name,l,r.length?r:'Expected instance of "${expected}" but got "${received}".')}}}catch(e){o=!0,i=e}finally{try{!n&&u.return&&u.return()}finally{if(o)throw i}}}},{key:"containsOnlyString",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.array(e,'Assert.containsOnlyString require valid array, got "${received}".'),this.string(t,"Custom error message passed to Assert.containsOnly needs to be a valid string.");var r=!0,n=!1,o=void 0;try{for(var i,u=e[Symbol.iterator]();!(r=(i=u.next()).done);r=!0){var l=i.value;try{this.string(l,t)}catch(r){throw s.expected("string",e.map(function(e){return a.toString(e)}).join(", "),t.length?t:'Expected array of "${expected}" but got "${received}".')}}}catch(e){n=!0,o=e}finally{try{!r&&u.return&&u.return()}finally{if(n)throw o}}}},{key:"containsOnlyInteger",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.array(e,'Assert.containsOnlyInteger require valid array, got "${received}".'),this.string(t,"Custom error message passed to Assert.containsOnly needs to be a valid string.");var r=!0,n=!1,o=void 0;try{for(var i,u=e[Symbol.iterator]();!(r=(i=u.next()).done);r=!0){var l=i.value;try{this.integer(l,t)}catch(r){throw s.expected("integer",e.map(function(e){return a.toString(e)}).join(", "),t.length?t:'Expected array of "${expected}" but got "${received}".')}}}catch(e){n=!0,o=e}finally{try{!r&&u.return&&u.return()}finally{if(n)throw o}}}},{key:"containsOnlyNumber",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.array(e,'Assert.containsOnlyNumber require valid array, got "${received}".'),this.string(t,"Custom error message passed to Assert.containsOnly needs to be a valid string.");var r=!0,n=!1,o=void 0;try{for(var i,u=e[Symbol.iterator]();!(r=(i=u.next()).done);r=!0){var l=i.value;try{this.number(l,t)}catch(r){throw s.expected("number",e.map(function(e){return a.toString(e)}).join(", "),t.length?t:'Expected array of "${expected}" but got "${received}".')}}}catch(e){n=!0,o=e}finally{try{!r&&u.return&&u.return()}finally{if(n)throw o}}}},{key:"count",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.integer(e),this.array(t),this.string(r,"Custom error message passed to Assert.count needs to be a valid string."),t.length!==e)throw r.length?r:"Expected count "+e+", got "+t.length}},{key:"notEmpty",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(this.string(t,"Custom error message passed to Assert.empty needs to be a valid string."),0===e.length)throw s.expected("not empty value",e,t)}},{key:"oddNumber",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(this.integer(e),this.string(t,"Custom error message passed to Assert.oddNumber needs to be a valid string."),e%2!==1)throw s.expected("odd number",e,t)}},{key:"evenNumber",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(this.integer(e),this.string(t,"Custom error message passed to Assert.evenNumber needs to be a valid string."),e%2!==0)throw s.expected("even number",e,t)}},{key:"jsonString",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.string(e),this.string(t,"Custom error message passed to Assert.jsonString needs to be a valid string.");try{JSON.parse(e)}catch(r){throw s.expected("json string",e,t)}}},{key:"email",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.string(e),this.string(t,"Custom error message passed to Assert.email needs to be a valid string.");var r=/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i;if(!r.test(e))throw s.expected("valid email address",e,t)}},{key:"url",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.string(e),this.string(t,"Custom error message passed to Assert.url needs to be a valid string.");var r=/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[\-;:&=\+\$,\w]+@)?[A-Za-z0-9\.\-]+|(?:www\.|[\-;:&=\+\$,\w]+@)[A-Za-z0-9\.\-]+)((?:\/[\+~%\/\.\w\-_]*)?\??(?:[\-\+=&;%@\.\w_]*)#?(?:[\.\!\/\\\w]*))?)/;if(!r.test(e))throw s.expected("valid url",e,t)}},{key:"uuid",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.string(e),this.string(t,"Custom error message passed to Assert.uuid needs to be a valid string.");var r=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;if(!r.test(e))throw s.expected("valid uuid",e,t)}},{key:"hasElement",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.string(e),this.instanceOneOf(t,[HTMLElement,HTMLDocument]),this.string(r,"Custom error message passed to Assert.hasProperty needs to be a valid string."),null===t.querySelector(e))throw s.expected('html element to has element under selector "'+e+'"',t.outerHTML,r)}},{key:"hasAttribute",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";this.string(e),this.instanceOf(t,HTMLElement),this.string(r,"Custom error message passed to Assert.hasAttribute needs to be a valid string.");var n=t.getAttribute(e);if(null===n)throw s.expected('html element with attribute "'+e+'"',t.outerHTML,r)}},{key:"hasAttributes",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";this.containsOnlyString(e),this.instanceOf(t,HTMLElement),this.string(n,"Custom error message passed to Assert.hasAttributes needs to be a valid string."),e.map(function(o){try{r.hasAttribute(o,t)}catch(r){throw s.expected('html element with attributes "'+e.join(", ")+'"',t.outerHTML,n)}})}}]),e}();e.exports=u},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:"";if("string"!=typeof r)throw new Error('Expected string but got "'+s.toString(r)+'".');return r.length?new Error(i.create(r,{expected:e,received:s.toString(t)})):new Error("Expected "+e+' but got "'+s.toString(t)+'".')}}]),e}();e.exports=a},function(e,t){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof e)throw new Error('Expected string but got "'+ValueConverter.toString(e)+'".');if("object"!==("undefined"==typeof t?"undefined":n(t)))throw new Error('Expected string but got "'+ValueConverter.toString(t)+'".');return e.replace(i,function(e,r){return t.hasOwnProperty(r)?t[r]:e})}}]),e}();e.exports=s},function(e,t){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var r=0;r