Comparing version 1.0.34 to 1.0.35
@@ -1,2 +0,2 @@ | ||
"use strict";function _callSuper(e,t,r){return t=_getPrototypeOf(t),_possibleConstructorReturn(e,_isNativeReflectConstruct()?Reflect.construct(t,r||[],_getPrototypeOf(e).constructor):t.apply(e,r))}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_isNativeReflectConstruct=function(){return!!e})()}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var s=t[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,_toPropertyKey(s.key),s)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var s=r.call(e,t||"default");if("object"!=_typeof(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _typeof(e){return _typeof="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},_typeof(e)}!function(e){if("object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Manyfest=e()}}((function(){return function e(t,r,s){function n(o,i){if(!r[o]){if(!t[o]){var c="function"==typeof require&&require;if(!i&&c)return c(o,!0);if(a)return a(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var u=r[o]={exports:{}};t[o][0].call(u.exports,(function(e){return n(t[o][1][e]||e)}),u,u.exports,e,t,r,s)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;o<s.length;o++)n(s[o]);return n}({1:[function(e,t,r){var s=function(){return _createClass((function e(t,r,s){_classCallCheck(this,e),"object"===_typeof(t)&&t.isFable?this.connectFable(t):this.fable=!1,this.fable?(this.UUID=t.getUUID(),this.options="object"===_typeof(r)?r:{}):(this.options="object"!==_typeof(t)||t.isFable?"object"===_typeof(r)?r:{}:t,this.UUID="CORE-SVC-".concat(Math.floor(89999*Math.random()+1e4))),this.serviceType="Unknown-".concat(this.UUID),this.Hash="string"==typeof s?s:this.fable||"string"!=typeof r?"".concat(this.UUID):r}),[{key:"connectFable",value:function(e){if("object"!==_typeof(e)||!e.isFable){var t="Fable Service Provider Base: Cannot connect to Fable, invalid Fable object passed in. The pFable parameter was a [".concat(_typeof(e),"].}");return console.log(t),new Error(t)}return this.fable||(this.fable=e),this.log||(this.log=this.fable.Logging),this.services||(this.services=this.fable.services),this.servicesMap||(this.servicesMap=this.fable.servicesMap),!0}}])}();_defineProperty(s,"isFableService",!0),t.exports=s,t.exports.CoreServiceProviderBase=s},{}],2:[function(e,t,r){t.exports=function(e,t){return t.startsWith(e)&&t.endsWith(e)?t.substring(1,t.length-1):t}},{}],3:[function(e,t,r){var s=e("./Manyfest-LogToConsole.js"),n=function(){return _createClass((function e(t,r){_classCallCheck(this,e),this.logInfo="function"==typeof t?t:s,this.logError="function"==typeof r?r:s,this.translationTable={}}),[{key:"translationCount",value:function(){return Object.keys(this.translationTable).length}},{key:"addTranslation",value:function(e){var t=this;if("object"!=_typeof(e))return this.logError("Hash translation addTranslation expected a translation be type object but was passed in ".concat(_typeof(e))),!1;Object.keys(e).forEach((function(r){"string"!=typeof e[r]?t.logError("Hash translation addTranslation expected a translation destination hash for [".concat(r,"] to be a string but the referrant was a ").concat(_typeof(e[r]))):t.translationTable[r]=e[r]}))}},{key:"removeTranslationHash",value:function(e){e in this.translationTable&&delete this.translationTable[e]}},{key:"removeTranslation",value:function(e){var t=this;return"string"==typeof e?(this.removeTranslationHash(e),!0):"object"==_typeof(e)?(Object.keys(e).forEach((function(e){t.removeTranslation(e)})),!0):(this.logError("Hash translation removeTranslation expected either a string or an object but the passed-in translation was type ".concat(_typeof(e))),!1)}},{key:"clearTranslations",value:function(){this.translationTable={}}},{key:"translate",value:function(e){return e in this.translationTable?this.translationTable[e]:e}}])}();t.exports=n},{"./Manyfest-LogToConsole.js":4}],4:[function(e,t,r){t.exports=function(e,t){var r="string"==typeof e?e:"";console.log("[Manyfest] ".concat(r)),t&&console.log(JSON.stringify(t))}},{}],5:[function(e,t,r){var s=e("./Manyfest-LogToConsole.js"),n=e("./Manyfest-ObjectAddress-GetValue.js"),a={DataFormat:e("./Manyfest-ObjectAddress-Parser.js")},o=function(){return _createClass((function e(){_classCallCheck(this,e),this.getObjectValueClass=new n(s,s)}),[{key:"checkAddressExists",value:function(e,t,r){if("object"!=_typeof(e))return!1;if("string"!=typeof t)return!1;var s=void 0===r?e:r,n=a.DataFormat.stringGetFirstSegment(t);if(n.length==t.length){var o=t.indexOf("["),i=t.indexOf("]"),c=t.indexOf("(");if(c>0&&a.DataFormat.stringCountEnclosures(t)>0){var l=t.substring(0,c).trim();return l in e&&"function"==typeof e[l]}if(o>0&&i>o&&i-o>1){var u=t.substring(0,o).trim();if("object"!==_typeof(e[u]))return!1;var f=t.substring(o+1,i).trim(),h=parseInt(f,10);return Array.isArray(e[u])!=isNaN(h)&&(isNaN(h)?(f=this.cleanWrapCharacters('"',f),f=this.cleanWrapCharacters("`",f),(f=this.cleanWrapCharacters("'",f))in e[u]):h in e[u])}return t in e}var d=n,p=t.substring(n.length+1),y=d.indexOf("["),g=d.indexOf("]"),b=d.indexOf("(");if(b>0&&a.DataFormat.stringCountEnclosures(d)>0){var v=d.substring(0,b).trim();if("function"==!_typeof(e[v]))return!1;var A=a.DataFormat.stringGetSegments(a.DataFormat.stringGetEnclosureValueByIndex(d.substring(v.length),0),",");if(0==A.length||""==A[0])return this.checkAddressExists(e[v].apply(e),p,s);for(var j=[],m=void 0===r?e:r,_=0;_<A.length;_++)j.push(this.getObjectValueClass.getValueAtAddress(m,A[_]));return this.checkAddressExists(e[v].apply(e,j),p,m)}if(y>0&&g>y&&g-y>1){var C=d.substring(0,y).trim(),O=d.substring(y+1,g).trim(),E=parseInt(O,10);return Array.isArray(e[C])!=isNaN(E)&&(isNaN(E)?(O=this.cleanWrapCharacters('"',O),O=this.cleanWrapCharacters("`",O),O=this.cleanWrapCharacters("'",O),this.checkAddressExists(e[C][O],p,s)):this.checkAddressExists(e[C][E],p,s))}return(!(d in e)||"object"===_typeof(e[d]))&&(d in e||(e[d]={}),this.checkAddressExists(e[d],p,s))}}])}();t.exports=o},{"./Manyfest-LogToConsole.js":4,"./Manyfest-ObjectAddress-GetValue.js":7,"./Manyfest-ObjectAddress-Parser.js":8}],6:[function(e,t,r){var s=e("./Manyfest-LogToConsole.js"),n=e("./Manyfest-CleanWrapCharacters.js"),a=e("../source/Manyfest-ParseConditionals.js"),o=function(){return _createClass((function e(t,r){_classCallCheck(this,e),this.logInfo="function"==typeof t?t:s,this.logError="function"==typeof r?r:s,this.cleanWrapCharacters=n}),[{key:"checkRecordFilters",value:function(e,t){return a(this,e,t)}},{key:"deleteValueAtAddress",value:function(e,t,r){if("object"==_typeof(e)&&"string"==typeof t){var s="";"string"==typeof r&&(s=r);var n=t.indexOf(".");if(-1==n){var a=t.indexOf("["),o=t.indexOf("]"),i=t.indexOf("{}");if(a>0&&o>a&&o-a>1){var c=t.substring(0,a).trim();if("object"!==_typeof(e[c]))return!1;var l=t.substring(a+1,o).trim(),u=parseInt(l,10);return Array.isArray(e[c])!=isNaN(u)&&(isNaN(u)?(l=this.cleanWrapCharacters('"',l),l=this.cleanWrapCharacters("`",l),l=this.cleanWrapCharacters("'",l),delete e[c][l],!0):(delete e[c][u],!0))}if(a>0&&o>a&&o-a==1){var f=t.substring(0,a).trim();if(!Array.isArray(e[f]))return!1;for(var h=e[f],d=h.length-1;d>=0;d--){this.checkRecordFilters(t,h[d])&&h.splice(d,1)}return!0}if(i>0){var p=t.substring(0,i).trim();return"object"==_typeof(e[p])&&(delete e[p],!0)}return delete e[t],!0}var y=t.substring(0,n),g=t.substring(n+1),b=y.indexOf("["),v=y.indexOf("]");if(b>0&&v>b&&v-b>1){var A=y.substring(0,b).trim(),j=y.substring(b+1,v).trim(),m=parseInt(j,10);return Array.isArray(e[A])!=isNaN(m)&&("object"==_typeof(e[A])&&(isNaN(m)?(j=this.cleanWrapCharacters('"',j),j=this.cleanWrapCharacters("`",j),j=this.cleanWrapCharacters("'",j),s="".concat(s).concat(s.length>0?".":"").concat(y),this.deleteValueAtAddress(e[A][j],g,s)):(s="".concat(s).concat(s.length>0?".":"").concat(y),this.deleteValueAtAddress(e[A][m],g,s))))}if(b>0&&v>b&&v-b==1){var _=t.substring(0,b).trim();if(!Array.isArray(e[_]))return!1;var C=e[_];s="".concat(s).concat(s.length>0?".":"").concat(_);for(var O={},E=0;E<C.length;E++){var T="".concat(s,"[").concat(E,"]"),k=this.deleteValueAtAddress(e[_][E],g,T);O["".concat(T,".").concat(g)]=k}return O}var D=t.indexOf("{}");if(D>0){var x=t.substring(0,D).trim();if("object"!=_typeof(e[x]))return!1;var V=e[x],M=Object.keys(V);s="".concat(s).concat(s.length>0?".":"").concat(x);for(var S={},N=0;N<M.length;N++){var w="".concat(s,".").concat(M[N]),H=this.deleteValueAtAddress(e[x][M[N]],g,w);this.checkRecordFilters(t,H)&&(S["".concat(w,".").concat(g)]=H)}return S}return y in e&&"object"!==_typeof(e[y])?void 0:y in e?(s="".concat(s).concat(s.length>0?".":"").concat(y),this.deleteValueAtAddress(e[y],g,s)):(s="".concat(s).concat(s.length>0?".":"").concat(y),e[y]={},this.deleteValueAtAddress(e[y],g,s))}}}])}();t.exports=o},{"../source/Manyfest-ParseConditionals.js":11,"./Manyfest-CleanWrapCharacters.js":2,"./Manyfest-LogToConsole.js":4}],7:[function(e,t,r){var s=e("./Manyfest-LogToConsole.js"),n=e("./Manyfest-CleanWrapCharacters.js"),a=e("../source/Manyfest-ParseConditionals.js"),o={DataFormat:e("./Manyfest-ObjectAddress-Parser.js")},i=function(){return _createClass((function e(t,r){_classCallCheck(this,e),this.logInfo="function"==typeof t?t:s,this.logError="function"==typeof r?r:s,this.cleanWrapCharacters=n}),[{key:"checkRecordFilters",value:function(e,t){return a(this,e,t)}},{key:"getValueAtAddress",value:function(e,t,r,s){if("object"==_typeof(e)&&"string"==typeof t){var n="";"string"==typeof r&&(n=r);var a=void 0===s?e:s,i=o.DataFormat.stringGetFirstSegment(t);if(""==i){for(var c=o.DataFormat.stringGetSegments(n),l=0,u=0;u<t.length&&"."==t.charAt(u);u++)l++;var f=c.length-l;if(f<0)return;var h=t.slice(l);return f>0&&(h="".concat(c.slice(0,f).join("."),".").concat(h)),this.logInfo("Back-navigation detected. Recursing back to address [".concat(h,"]")),this.getValueAtAddress(a,h)}if(i.length==t.length){var d=t.indexOf("["),p=t.indexOf("]"),y=t.indexOf("{}"),g=t.indexOf("(");if(g>0&&o.DataFormat.stringCountEnclosures(t)>0){var b=t.substring(0,g).trim();if("function"==!_typeof(e[b]))return!1;var v=o.DataFormat.stringGetSegments(o.DataFormat.stringGetEnclosureValueByIndex(t.substring(b.length),0),",");if(0==v.length||""==v[0])return e[b].apply(e);for(var A=[],j=void 0===s?e:s,m=0;m<v.length;m++)!(v[m].length>=2)||'"'!=v[m].charAt(0)&&"'"!=v[m].charAt(0)&&"`"!=v[m].charAt(0)||'"'!=v[m].charAt(v[m].length-1)&&"'"!=v[m].charAt(v[m].length-1)&&"`"!=v[m].charAt(v[m].length-1)?A.push(this.getValueAtAddress(j,v[m])):A.push(v[m].substring(1,v[m].length-1));return e[b].apply(e,A)}if(d>0&&p>d&&p-d>1){var _=t.substring(0,d).trim();if("object"!==_typeof(e[_]))return;var C=t.substring(d+1,p).trim(),O=parseInt(C,10);if(Array.isArray(e[_])==isNaN(O))return;return isNaN(O)?(C=this.cleanWrapCharacters('"',C),C=this.cleanWrapCharacters("`",C),C=this.cleanWrapCharacters("'",C),e[_][C]):e[_][O]}if(d>0&&p>d&&p-d==1){var E=t.substring(0,d).trim();if(!Array.isArray(e[E]))return!1;for(var T=e[E],k=[],D=0;D<T.length;D++){this.checkRecordFilters(t,T[D])&&k.push(T[D])}return k}if(y>0){var x=t.substring(0,y).trim();return"object"==_typeof(e[x])&&e[x]}return null!=_typeof(e[t])?e[t]:void 0}var V=i,M=t.substring(i.length+1),S=V.indexOf("["),N=V.indexOf("]"),w=V.indexOf("(");if(w>0&&o.DataFormat.stringCountEnclosures(V)>0){var H=V.substring(0,w).trim();if(n="".concat(n).concat(n.length>0?".":"").concat(V),"function"==!_typeof(e[H]))return!1;var P=o.DataFormat.stringGetSegments(o.DataFormat.stringGetEnclosureValueByIndex(V.substring(H.length),0),",");if(0==P.length||""==P[0])return this.getValueAtAddress(e[H].apply(e),M,n,a);for(var I=[],F=void 0===s?e:s,W=0;W<P.length;W++)!(P[W].length>=2)||'"'!=P[W].charAt(0)&&"'"!=P[W].charAt(0)&&"`"!=P[W].charAt(0)||'"'!=P[W].charAt(P[W].length-1)&&"'"!=P[W].charAt(P[W].length-1)&&"`"!=P[W].charAt(P[W].length-1)?I.push(this.getValueAtAddress(F,P[W])):I.push(P[W].substring(1,P[W].length-1));return this.getValueAtAddress(e[H].apply(e,I),M,n,F)}if(S>0&&N>S&&N-S>1){var R=V.substring(0,S).trim(),L=V.substring(S+1,N).trim(),G=parseInt(L,10);if(Array.isArray(e[R])==isNaN(G))return;if("object"!=_typeof(e[R]))return;return isNaN(G)?(L=this.cleanWrapCharacters('"',L),L=this.cleanWrapCharacters("`",L),L=this.cleanWrapCharacters("'",L),n="".concat(n).concat(n.length>0?".":"").concat(V),this.getValueAtAddress(e[R][L],M,n,a)):(n="".concat(n).concat(n.length>0?".":"").concat(V),this.getValueAtAddress(e[R][G],M,n,a))}if(S>0&&N>S&&N-S==1){var J=t.substring(0,S).trim();if(!Array.isArray(e[J]))return!1;var B=e[J];n="".concat(n).concat(n.length>0?".":"").concat(J);for(var U={},z=0;z<B.length;z++){var q="".concat(n,"[").concat(z,"]"),K=this.getValueAtAddress(e[J][z],M,q,a);U["".concat(q,".").concat(M)]=K}return U}var Q=t.indexOf("{}");if(Q>0){var X=t.substring(0,Q).trim();if("object"!=_typeof(e[X]))return!1;var Y=e[X],Z=Object.keys(Y);n="".concat(n).concat(n.length>0?".":"").concat(X);for(var $={},ee=0;ee<Z.length;ee++){var te="".concat(n,".").concat(Z[ee]),re=this.getValueAtAddress(e[X][Z[ee]],M,te,a);this.checkRecordFilters(t,re)&&($["".concat(te,".").concat(M)]=re)}return $}return V in e&&"object"!==_typeof(e[V])?void 0:V in e?(n="".concat(n).concat(n.length>0?".":"").concat(V),this.getValueAtAddress(e[V],M,n,a)):(n="".concat(n).concat(n.length>0?".":"").concat(V),e[V]={},this.getValueAtAddress(e[V],M,n,a))}}}])}();t.exports=i},{"../source/Manyfest-ParseConditionals.js":11,"./Manyfest-CleanWrapCharacters.js":2,"./Manyfest-LogToConsole.js":4,"./Manyfest-ObjectAddress-Parser.js":8}],8:[function(e,t,r){t.exports={stringCountSegments:function(e,t,r,s){var n="string"==typeof e?e:"",a="string"==typeof t?t:".",o="object"==_typeof(r)?pEnclosureStart:{"{":0,"[":1,"(":2},i="object"==_typeof(s)?pEnclosureEnd:{"}":0,"]":1,")":2};if(e.length<1)return 0;for(var c=1,l=[],u=0;u<n.length;u++)n[u]==a&&0==l.length?c++:n[u]in o?l.push(o[n[u]]):n[u]in i&&i[n[u]]==l[l.length-1]&&l.pop();return c},stringGetFirstSegment:function(e,t,r,s){var n="string"==typeof e?e:"",a="string"==typeof t?t:".",o="object"==_typeof(r)?pEnclosureStart:{"{":0,"[":1,"(":2},i="object"==_typeof(s)?pEnclosureEnd:{"}":0,"]":1,")":2};if(e.length<1)return 0;for(var c=[],l=0;l<n.length;l++){if(n[l]==a&&0==c.length)return n.substring(0,l);n[l]in o?c.push(o[n[l]]):n[l]in i&&i[n[l]]==c[c.length-1]&&c.pop()}return n},stringGetSegments:function(e,t,r,s){var n="string"==typeof e?e:"",a="string"==typeof t?t:".",o="object"==_typeof(r)?pEnclosureStart:{"{":0,"[":1,"(":2},i="object"==_typeof(s)?pEnclosureEnd:{"}":0,"]":1,")":2},c=0,l=[];if(e.length<1)return l;for(var u=[],f=0;f<n.length;f++)n[f]==a&&0==u.length?(l.push(n.substring(c,f)),c=f+1):n[f]in o?u.push(o[n[f]]):n[f]in i&&i[n[f]]==u[u.length-1]&&u.pop();return c<n.length&&l.push(n.substring(c)),l},stringCountEnclosures:function(e,t,r){for(var s="string"==typeof e?e:"",n="string"==typeof t?t:"(",a="string"==typeof r?r:")",o=0,i=0,c=0;c<s.length;c++)s[c]==n?(0==i&&o++,i++):s[c]==a&&i--;return o},stringGetEnclosureValueByIndex:function(e,t,r,s){for(var n="string"==typeof e?e:"",a="number"==typeof t?t:0,o="string"==typeof r?r:"(",i="string"==typeof s?s:")",c=0,l=0,u=!1,f=0,h=0,d=0;d<n.length;d++)n[d]==o?1==++l&&a==++c-1&&(u=!0,f=d):n[d]==i&&0==--l&&u&&h<=f&&(h=d,u=!1);return c<=a?"":h>0&&h>f?n.substring(f+1,h):n.substring(f+1)}}},{}],9:[function(e,t,r){var s=e("./Manyfest-LogToConsole.js"),n=e("./Manyfest-CleanWrapCharacters.js"),a=function(){return _createClass((function e(t,r){_classCallCheck(this,e),this.logInfo="function"==typeof t?t:s,this.logError="function"==typeof r?r:s,this.cleanWrapCharacters=n}),[{key:"setValueAtAddress",value:function(e,t,r){if("object"!=_typeof(e))return!1;if("string"!=typeof t)return!1;var s=t.indexOf(".");if(-1==s){var n=t.indexOf("["),a=t.indexOf("]");if(n>0&&a>n&&a-n>1){var o=t.substring(0,n).trim();if("object"!==_typeof(e[o]))return!1;var i=t.substring(n+1,a).trim(),c=parseInt(i,10);return Array.isArray(e[o])!=isNaN(c)&&(isNaN(c)?(i=this.cleanWrapCharacters('"',i),i=this.cleanWrapCharacters("`",i),i=this.cleanWrapCharacters("'",i),e[o][i]=r,!0):(e[o][c]=r,!0))}return e[t]=r,!0}var l=t.substring(0,s),u=t.substring(s+1),f=l.indexOf("["),h=l.indexOf("]");if(f>0&&h>f&&h-f>1){var d=l.substring(0,f).trim(),p=l.substring(f+1,h).trim(),y=parseInt(p,10);return Array.isArray(e[d])!=isNaN(y)&&(isNaN(y)?(p=this.cleanWrapCharacters('"',p),p=this.cleanWrapCharacters("`",p),p=this.cleanWrapCharacters("'",p),this.setValueAtAddress(e[d][p],u,r)):this.setValueAtAddress(e[d][y],u,r))}return l in e&&"object"!==_typeof(e[l])?("__ERROR"in e||(e.__ERROR={}),e.__ERROR[t]=r,!1):(l in e||(e[l]={}),this.setValueAtAddress(e[l],u,r))}}])}();t.exports=a},{"./Manyfest-CleanWrapCharacters.js":2,"./Manyfest-LogToConsole.js":4}],10:[function(e,t,r){var s=e("./Manyfest-LogToConsole.js"),n=function(){return _createClass((function e(t,r){_classCallCheck(this,e),this.logInfo="function"==typeof t?t:s,this.logError="function"==typeof r?r:s}),[{key:"generateAddressses",value:function(e,t,r){var s="string"==typeof t?t:"",n="object"==_typeof(r)?r:{},a=_typeof(e),o={Address:s,Hash:s,Name:s,InSchema:!1};switch("object"==a&&null==e&&(a="null"),a){case"string":o.DataType="String",o.Default=e,n[s]=o;break;case"number":case"bigint":o.DataType="Number",o.Default=e,n[s]=o;break;case"undefined":case"null":o.DataType="Any",o.Default=e,n[s]=o;break;case"object":if(Array.isArray(e)){o.DataType="Array",""!=s&&(n[s]=o);for(var i=0;i<e.length;i++)this.generateAddressses(e[i],"".concat(s,"[").concat(i,"]"),n)}else{o.DataType="Object",""!=s&&(n[s]=o,s+=".");for(var c=Object.keys(e),l=0;l<c.length;l++)this.generateAddressses(e[c[l]],"".concat(s).concat(c[l]),n)}}return n}}])}();t.exports=n},{"./Manyfest-LogToConsole.js":4}],11:[function(e,t,r){var s="<<~?",n="?~>>",a=function(e,t,r,s,n){switch(s){case"TRUE":return!0===e.getValueAtAddress(t,r);case"FALSE":return!1===e.getValueAtAddress(t,r);case"LNGT":case"LENGTH_GREATER_THAN":switch(_typeof(e.getValueAtAddress(t,r))){case"string":case"object":return e.getValueAtAddress(t,r).length>n;default:return!1}break;case"LNLT":case"LENGTH_LESS_THAN":switch(_typeof(e.getValueAtAddress(t,r))){case"string":case"object":return e.getValueAtAddress(t,r).length<n;default:return!1}break;case"!=":return e.getValueAtAddress(t,r)!=n;case"<":return e.getValueAtAddress(t,r)<n;case">":return e.getValueAtAddress(t,r)>n;case"<=":return e.getValueAtAddress(t,r)<=n;case">=":return e.getValueAtAddress(t,r)>=n;case"===":return e.getValueAtAddress(t,r)===n;default:return e.getValueAtAddress(t,r)==n}};t.exports=function(e,t,r){for(var o=!0,i=t.indexOf(s);-1!=i;){var c=t.indexOf(n,i+4);if(-1!=c){var l=t.substring(i+4,c).split(","),u=l[0],f="EXISTS";l.length>1&&(f=l[1]);var h=!1;l.length>2&&(h=l[2]),o=o&&a(e,r,u,f,h),i=t.indexOf(s,c+4)}else i=-1}return o}},{}],12:[function(e,t,r){var s=e("./Manyfest-LogToConsole.js"),n=function(){return _createClass((function e(t,r){_classCallCheck(this,e),this.logInfo="function"==typeof t?t:s,this.logError="function"==typeof r?r:s}),[{key:"resolveAddressMappings",value:function(e,t){if("object"!=_typeof(e))return this.logError("Attempted to resolve address mapping but the descriptor was not an object."),!1;if("object"!=_typeof(t))return!0;var r=Object.keys(e),s={};return r.forEach((function(t){"Hash"in e[t]&&(s[e[t].Hash]=t)})),Object.keys(t).forEach((function(r){var n=t[r],a=!1,o=!1;r in e?a=r:r in s&&(a=s[r]),a?(o=e[a],delete e[a]):o={Hash:r},e[n]=o})),!0}},{key:"safeResolveAddressMappings",value:function(e,t){var r=JSON.parse(JSON.stringify(e));return this.resolveAddressMappings(r,t),r}},{key:"mergeAddressMappings",value:function(e,t){if("object"!=_typeof(t)||"object"!=_typeof(e))return this.logError("Attempted to merge two schema descriptors but both were not objects."),!1;var r=JSON.parse(JSON.stringify(t)),s=JSON.parse(JSON.stringify(e));return Object.keys(r).forEach((function(e){e in s||(s[e]=r[e])})),s}}])}();t.exports=n},{"./Manyfest-LogToConsole.js":4}],13:[function(e,t,r){var s=e("fable-serviceproviderbase"),n=e("./Manyfest-LogToConsole.js"),a=e("./Manyfest-HashTranslation.js"),o=e("./Manyfest-ObjectAddress-CheckAddressExists.js"),i=e("./Manyfest-ObjectAddress-GetValue.js"),c=e("./Manyfest-ObjectAddress-SetValue.js"),l=e("./Manyfest-ObjectAddress-DeleteValue.js"),u=e("./Manyfest-ObjectAddressGeneration.js"),f=e("./Manyfest-SchemaManipulation.js"),h={Scope:"DEFAULT",Descriptors:{}},d=function(e){function t(e,r,s){var h;return _classCallCheck(this,t),(h=_callSuper(this,t,void 0===e?[{}]:[e,r,s])).serviceType="Manifest",h.logInfo=n,h.logError=n,h.objectAddressCheckAddressExists=new o(h.logInfo,h.logError),h.objectAddressGetValue=new i(h.logInfo,h.logError),h.objectAddressSetValue=new c(h.logInfo,h.logError),h.objectAddressDeleteValue=new l(h.logInfo,h.logError),"defaultValues"in h.options||(h.options.defaultValues={String:"",Number:0,Float:0,Integer:0,Boolean:!1,Binary:0,DateTime:0,Array:[],Object:{},Null:null}),"strict"in h.options||(h.options.strict=!1),h.scope=void 0,h.elementAddresses=void 0,h.elementHashes=void 0,h.elementDescriptors=void 0,h.reset(),"object"===_typeof(h.options)&&h.loadManifest(h.options),h.schemaManipulations=new f(h.logInfo,h.logError),h.objectAddressGeneration=new u(h.logInfo,h.logError),h.hashTranslations=new a(h.logInfo,h.logError),_assertThisInitialized(h)}return _inherits(t,e),_createClass(t,[{key:"reset",value:function(){this.scope="DEFAULT",this.elementAddresses=[],this.elementHashes={},this.elementDescriptors={}}},{key:"clone",value:function(){var e=JSON.parse(JSON.stringify(this.options)),r=new t(this.getManifest(),this.logInfo,this.logError,e);return r.hashTranslations.addTranslation(this.hashTranslations.translationTable),r}},{key:"deserialize",value:function(e){return this.loadManifest(JSON.parse(e))}},{key:"loadManifest",value:function(e){"object"!==_typeof(e)&&this.logError("(".concat(this.scope,") Error loading manifest; expecting an object but parameter was type ").concat(_typeof(e),"."));for(var t="object"==_typeof(e)?e:{},r=Object.keys(h),s=0;s<r.length;s++)r[s]in t||(t[r[s]]=JSON.parse(JSON.stringify(h[r[s]])));if("Scope"in t?"string"==typeof t.Scope?this.scope=t.Scope:this.logError("(".concat(this.scope,") Error loading scope from manifest; expecting a string but property was type ").concat(_typeof(t.Scope),"."),t):this.logError("(".concat(this.scope,') Error loading scope from manifest object. Property "Scope" does not exist in the root of the object.'),t),"Descriptors"in t)if("object"===_typeof(t.Descriptors))for(var n=Object.keys(t.Descriptors),a=0;a<n.length;a++)this.addDescriptor(n[a],t.Descriptors[n[a]]);else this.logError("(".concat(this.scope,") Error loading description object from manifest object. Expecting an object in 'Manifest.Descriptors' but the property was type ").concat(_typeof(t.Descriptors),"."),t);else this.logError("(".concat(this.scope,') Error loading object description from manifest object. Property "Descriptors" does not exist in the root of the Manifest object.'),t);if("HashTranslations"in t&&"object"===_typeof(t.HashTranslations))for(var o=0;o<t.HashTranslations.length;o++);}},{key:"serialize",value:function(){return JSON.stringify(this.getManifest())}},{key:"getManifest",value:function(){return{Scope:this.scope,Descriptors:JSON.parse(JSON.stringify(this.elementDescriptors)),HashTranslations:JSON.parse(JSON.stringify(this.hashTranslations.translationTable))}}},{key:"addDescriptor",value:function(e,t){return"object"===_typeof(t)?("Address"in t||(t.Address=e),e in this.elementDescriptors||this.elementAddresses.push(e),this.elementDescriptors[e]=t,this.elementHashes[e]=e,"Hash"in t?this.elementHashes[t.Hash]=e:t.Hash=e,!0):(this.logError("(".concat(this.scope,") Error loading object descriptor for address '").concat(e,"' from manifest object. Expecting an object but property was type ").concat(_typeof(t),".")),!1)}},{key:"getDescriptorByHash",value:function(e){return this.getDescriptor(this.resolveHashAddress(e))}},{key:"getDescriptor",value:function(e){return this.elementDescriptors[e]}},{key:"eachDescriptor",value:function(e){for(var t=Object.keys(this.elementDescriptors),r=0;r<t.length;r++)e(this.elementDescriptors[t[r]])}},{key:"checkAddressExistsByHash",value:function(e,t){return this.checkAddressExists(e,this.resolveHashAddress(t))}},{key:"checkAddressExists",value:function(e,t){return this.objectAddressCheckAddressExists.checkAddressExists(e,t)}},{key:"resolveHashAddress",value:function(e){var t=e in this.elementHashes,r=e in this.hashTranslations.translationTable;return t&&!r?this.elementHashes[e]:r&&this.hashTranslations.translate(e)in this.elementHashes?this.elementHashes[this.hashTranslations.translate(e)]:r?this.hashTranslations.translate(e):e}},{key:"getValueByHash",value:function(e,t){var r=this.getValueAtAddress(e,this.resolveHashAddress(t));return void 0===r&&(r=this.getDefaultValue(this.getDescriptorByHash(t))),r}},{key:"getValueAtAddress",value:function(e,t){var r=this.objectAddressGetValue.getValueAtAddress(e,t);return void 0===r&&(r=this.getDefaultValue(this.getDescriptor(t))),r}},{key:"setValueByHash",value:function(e,t,r){return this.setValueAtAddress(e,this.resolveHashAddress(t),r)}},{key:"setValueAtAddress",value:function(e,t,r){return this.objectAddressSetValue.setValueAtAddress(e,t,r)}},{key:"deleteValueByHash",value:function(e,t,r){return this.deleteValueAtAddress(e,this.resolveHashAddress(t),r)}},{key:"deleteValueAtAddress",value:function(e,t,r){return this.objectAddressDeleteValue.deleteValueAtAddress(e,t,r)}},{key:"validate",value:function(e){var t={Error:null,Errors:[],MissingElements:[]};"object"!==_typeof(e)&&(t.Error=!0,t.Errors.push("Expected passed in object to be type object but was passed in ".concat(_typeof(e))));for(var r=function(e,r){t.Error=!0,t.Errors.push('Element at address "'.concat(e,'" ').concat(r,"."))},s=0;s<this.elementAddresses.length;s++){var n=this.getDescriptor(this.elementAddresses[s]),a=this.checkAddressExists(e,n.Address),o=this.getValueAtAddress(e,n.Address);if(void 0!==o&&a||(t.MissingElements.push(n.Address),(n.Required||this.options.strict)&&r(n.Address,"is flagged REQUIRED but is not set in the object")),n.DataType){var i=_typeof(o);switch(n.DataType.toString().trim().toLowerCase()){case"string":"string"!=i&&r(n.Address,"has a DataType ".concat(n.DataType," but is of the type ").concat(i));break;case"number":"number"!=i&&r(n.Address,"has a DataType ".concat(n.DataType," but is of the type ").concat(i));break;case"integer":if("number"!=i)r(n.Address,"has a DataType ".concat(n.DataType," but is of the type ").concat(i));else o.toString().indexOf(".")>-1&&r(n.Address,"has a DataType ".concat(n.DataType," but has a decimal point in the number."));break;case"float":"number"!=i&&r(n.Address,"has a DataType ".concat(n.DataType," but is of the type ").concat(i));break;case"DateTime":"Invalid Date"==new Date(o).toString()&&r(n.Address,"has a DataType ".concat(n.DataType," but is not parsable as a Date by Javascript"));default:"string"!=i&&r(n.Address,"has a DataType ".concat(n.DataType," (which auto-converted to String because it was unrecognized) but is of the type ").concat(i))}}}return t}},{key:"getDefaultValue",value:function(e){if("object"==_typeof(e)){if("Default"in e)return e.Default;var t="DataType"in e?e.DataType:"String";return t in this.options.defaultValues?this.options.defaultValues[t]:null}}},{key:"populateDefaults",value:function(e,t){return this.populateObject(e,t,(function(e){return"Default"in e}))}},{key:"populateObject",value:function(e,t,r){var s=this,n="object"===_typeof(e)?e:{},a=void 0!==t&&t,o="function"==typeof r?r:function(e){return!0};return this.elementAddresses.forEach((function(e){var t=s.getDescriptor(e);o(t)&&(!a&&s.checkAddressExists(n,e)||s.setValueAtAddress(n,e,s.getDefaultValue(t)))})),n}}])}(s);t.exports=d},{"./Manyfest-HashTranslation.js":3,"./Manyfest-LogToConsole.js":4,"./Manyfest-ObjectAddress-CheckAddressExists.js":5,"./Manyfest-ObjectAddress-DeleteValue.js":6,"./Manyfest-ObjectAddress-GetValue.js":7,"./Manyfest-ObjectAddress-SetValue.js":9,"./Manyfest-ObjectAddressGeneration.js":10,"./Manyfest-SchemaManipulation.js":12,"fable-serviceproviderbase":1}]},{},[13])(13)})); | ||
"use strict";function _callSuper(e,t,r){return t=_getPrototypeOf(t),_possibleConstructorReturn(e,_isNativeReflectConstruct()?Reflect.construct(t,r||[],_getPrototypeOf(e).constructor):t.apply(e,r))}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_isNativeReflectConstruct=function(){return!!e})()}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var s=t[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,_toPropertyKey(s.key),s)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var s=r.call(e,t||"default");if("object"!=_typeof(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _typeof(e){return _typeof="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},_typeof(e)}!function(e){if("object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Manyfest=e()}}((function(){return function e(t,r,s){function n(o,i){if(!r[o]){if(!t[o]){var c="function"==typeof require&&require;if(!i&&c)return c(o,!0);if(a)return a(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var u=r[o]={exports:{}};t[o][0].call(u.exports,(function(e){return n(t[o][1][e]||e)}),u,u.exports,e,t,r,s)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;o<s.length;o++)n(s[o]);return n}({1:[function(e,t,r){var s=function(){return _createClass((function e(t,r,s){_classCallCheck(this,e),"object"===_typeof(t)&&t.isFable?this.connectFable(t):this.fable=!1,this.fable?(this.UUID=t.getUUID(),this.options="object"===_typeof(r)?r:{}):(this.options="object"!==_typeof(t)||t.isFable?"object"===_typeof(r)?r:{}:t,this.UUID="CORE-SVC-".concat(Math.floor(89999*Math.random()+1e4))),this.serviceType="Unknown-".concat(this.UUID),this.Hash="string"==typeof s?s:this.fable||"string"!=typeof r?"".concat(this.UUID):r}),[{key:"connectFable",value:function(e){if("object"!==_typeof(e)||!e.isFable){var t="Fable Service Provider Base: Cannot connect to Fable, invalid Fable object passed in. The pFable parameter was a [".concat(_typeof(e),"].}");return console.log(t),new Error(t)}return this.fable||(this.fable=e),this.log||(this.log=this.fable.Logging),this.services||(this.services=this.fable.services),this.servicesMap||(this.servicesMap=this.fable.servicesMap),!0}}])}();_defineProperty(s,"isFableService",!0),t.exports=s,t.exports.CoreServiceProviderBase=s},{}],2:[function(e,t,r){t.exports=function(e,t){return t.startsWith(e)&&t.endsWith(e)?t.substring(1,t.length-1):t}},{}],3:[function(e,t,r){var s=e("./Manyfest-LogToConsole.js"),n=function(){return _createClass((function e(t,r){_classCallCheck(this,e),this.logInfo="function"==typeof t?t:s,this.logError="function"==typeof r?r:s,this.translationTable={}}),[{key:"translationCount",value:function(){return Object.keys(this.translationTable).length}},{key:"addTranslation",value:function(e){var t=this;if("object"!=_typeof(e))return this.logError("Hash translation addTranslation expected a translation be type object but was passed in ".concat(_typeof(e))),!1;Object.keys(e).forEach((function(r){"string"!=typeof e[r]?t.logError("Hash translation addTranslation expected a translation destination hash for [".concat(r,"] to be a string but the referrant was a ").concat(_typeof(e[r]))):t.translationTable[r]=e[r]}))}},{key:"removeTranslationHash",value:function(e){e in this.translationTable&&delete this.translationTable[e]}},{key:"removeTranslation",value:function(e){var t=this;return"string"==typeof e?(this.removeTranslationHash(e),!0):"object"==_typeof(e)?(Object.keys(e).forEach((function(e){t.removeTranslation(e)})),!0):(this.logError("Hash translation removeTranslation expected either a string or an object but the passed-in translation was type ".concat(_typeof(e))),!1)}},{key:"clearTranslations",value:function(){this.translationTable={}}},{key:"translate",value:function(e){return e in this.translationTable?this.translationTable[e]:e}}])}();t.exports=n},{"./Manyfest-LogToConsole.js":4}],4:[function(e,t,r){t.exports=function(e,t){var r="string"==typeof e?e:"";console.log("[Manyfest] ".concat(r)),t&&console.log(JSON.stringify(t))}},{}],5:[function(e,t,r){var s=e("./Manyfest-LogToConsole.js"),n=e("./Manyfest-ObjectAddress-GetValue.js"),a={DataFormat:e("./Manyfest-ObjectAddress-Parser.js")},o=function(){return _createClass((function e(){_classCallCheck(this,e),this.getObjectValueClass=new n(s,s)}),[{key:"checkAddressExists",value:function(e,t,r){if("object"!=_typeof(e))return!1;if("string"!=typeof t)return!1;var s=void 0===r?e:r,n=a.DataFormat.stringGetFirstSegment(t);if(n.length==t.length){var o=t.indexOf("["),i=t.indexOf("]"),c=t.indexOf("(");if(c>0&&a.DataFormat.stringCountEnclosures(t)>0){var l=t.substring(0,c).trim();return l in e&&"function"==typeof e[l]}if(o>0&&i>o&&i-o>1){var u=t.substring(0,o).trim();if("object"!==_typeof(e[u]))return!1;var f=t.substring(o+1,i).trim(),h=parseInt(f,10);return Array.isArray(e[u])!=isNaN(h)&&(isNaN(h)?(f=this.cleanWrapCharacters('"',f),f=this.cleanWrapCharacters("`",f),(f=this.cleanWrapCharacters("'",f))in e[u]):h in e[u])}return t in e}var d=n,p=t.substring(n.length+1),y=d.indexOf("["),g=d.indexOf("]"),b=d.indexOf("(");if(b>0&&a.DataFormat.stringCountEnclosures(d)>0){var v=d.substring(0,b).trim();if("function"==!_typeof(e[v]))return!1;var A=a.DataFormat.stringGetSegments(a.DataFormat.stringGetEnclosureValueByIndex(d.substring(v.length),0),",");if(0==A.length||""==A[0])return this.checkAddressExists(e[v].apply(e),p,s);for(var j=[],m=void 0===r?e:r,_=0;_<A.length;_++)j.push(this.getObjectValueClass.getValueAtAddress(m,A[_]));return this.checkAddressExists(e[v].apply(e,j),p,m)}if(y>0&&g>y&&g-y>1){var C=d.substring(0,y).trim(),O=d.substring(y+1,g).trim(),E=parseInt(O,10);return Array.isArray(e[C])!=isNaN(E)&&(isNaN(E)?(O=this.cleanWrapCharacters('"',O),O=this.cleanWrapCharacters("`",O),O=this.cleanWrapCharacters("'",O),this.checkAddressExists(e[C][O],p,s)):this.checkAddressExists(e[C][E],p,s))}return(!(d in e)||"object"===_typeof(e[d]))&&(d in e||(e[d]={}),this.checkAddressExists(e[d],p,s))}}])}();t.exports=o},{"./Manyfest-LogToConsole.js":4,"./Manyfest-ObjectAddress-GetValue.js":7,"./Manyfest-ObjectAddress-Parser.js":8}],6:[function(e,t,r){var s=e("./Manyfest-LogToConsole.js"),n=e("./Manyfest-CleanWrapCharacters.js"),a=e("../source/Manyfest-ParseConditionals.js"),o=function(){return _createClass((function e(t,r){_classCallCheck(this,e),this.logInfo="function"==typeof t?t:s,this.logError="function"==typeof r?r:s,this.cleanWrapCharacters=n}),[{key:"checkRecordFilters",value:function(e,t){return a(this,e,t)}},{key:"deleteValueAtAddress",value:function(e,t,r){if("object"==_typeof(e)&&"string"==typeof t){var s="";"string"==typeof r&&(s=r);var n=t.indexOf(".");if(-1==n){var a=t.indexOf("["),o=t.indexOf("]"),i=t.indexOf("{}");if(a>0&&o>a&&o-a>1){var c=t.substring(0,a).trim();if("object"!==_typeof(e[c]))return!1;var l=t.substring(a+1,o).trim(),u=parseInt(l,10);return Array.isArray(e[c])!=isNaN(u)&&(isNaN(u)?(l=this.cleanWrapCharacters('"',l),l=this.cleanWrapCharacters("`",l),l=this.cleanWrapCharacters("'",l),delete e[c][l],!0):(delete e[c][u],!0))}if(a>0&&o>a&&o-a==1){var f=t.substring(0,a).trim();if(!Array.isArray(e[f]))return!1;for(var h=e[f],d=h.length-1;d>=0;d--){this.checkRecordFilters(t,h[d])&&h.splice(d,1)}return!0}if(i>0){var p=t.substring(0,i).trim();return"object"==_typeof(e[p])&&(delete e[p],!0)}return delete e[t],!0}var y=t.substring(0,n),g=t.substring(n+1),b=y.indexOf("["),v=y.indexOf("]");if(b>0&&v>b&&v-b>1){var A=y.substring(0,b).trim(),j=y.substring(b+1,v).trim(),m=parseInt(j,10);return Array.isArray(e[A])!=isNaN(m)&&("object"==_typeof(e[A])&&(isNaN(m)?(j=this.cleanWrapCharacters('"',j),j=this.cleanWrapCharacters("`",j),j=this.cleanWrapCharacters("'",j),s="".concat(s).concat(s.length>0?".":"").concat(y),this.deleteValueAtAddress(e[A][j],g,s)):(s="".concat(s).concat(s.length>0?".":"").concat(y),this.deleteValueAtAddress(e[A][m],g,s))))}if(b>0&&v>b&&v-b==1){var _=t.substring(0,b).trim();if(!Array.isArray(e[_]))return!1;var C=e[_];s="".concat(s).concat(s.length>0?".":"").concat(_);for(var O={},E=0;E<C.length;E++){var T="".concat(s,"[").concat(E,"]"),D=this.deleteValueAtAddress(e[_][E],g,T);O["".concat(T,".").concat(g)]=D}return O}var k=t.indexOf("{}");if(k>0){var x=t.substring(0,k).trim();if("object"!=_typeof(e[x]))return!1;var V=e[x],M=Object.keys(V);s="".concat(s).concat(s.length>0?".":"").concat(x);for(var S={},N=0;N<M.length;N++){var w="".concat(s,".").concat(M[N]),H=this.deleteValueAtAddress(e[x][M[N]],g,w);this.checkRecordFilters(t,H)&&(S["".concat(w,".").concat(g)]=H)}return S}return y in e&&"object"!==_typeof(e[y])?void 0:y in e?(s="".concat(s).concat(s.length>0?".":"").concat(y),this.deleteValueAtAddress(e[y],g,s)):(s="".concat(s).concat(s.length>0?".":"").concat(y),e[y]={},this.deleteValueAtAddress(e[y],g,s))}}}])}();t.exports=o},{"../source/Manyfest-ParseConditionals.js":11,"./Manyfest-CleanWrapCharacters.js":2,"./Manyfest-LogToConsole.js":4}],7:[function(e,t,r){var s=e("./Manyfest-LogToConsole.js"),n=e("./Manyfest-CleanWrapCharacters.js"),a=e("../source/Manyfest-ParseConditionals.js"),o={DataFormat:e("./Manyfest-ObjectAddress-Parser.js")},i=function(){return _createClass((function e(t,r){_classCallCheck(this,e),this.logInfo="function"==typeof t?t:s,this.logError="function"==typeof r?r:s,this.cleanWrapCharacters=n}),[{key:"checkRecordFilters",value:function(e,t){return a(this,e,t)}},{key:"getValueAtAddress",value:function(e,t,r,s){if("object"==_typeof(e)&&"string"==typeof t){var n="";"string"==typeof r&&(n=r);var a=void 0===s?e:s,i=o.DataFormat.stringGetFirstSegment(t);if(""==i){for(var c=o.DataFormat.stringGetSegments(n),l=0,u=0;u<t.length&&"."==t.charAt(u);u++)l++;var f=c.length-l;if(f<0)return;var h=t.slice(l);return f>0&&(h="".concat(c.slice(0,f).join("."),".").concat(h)),this.logInfo("Back-navigation detected. Recursing back to address [".concat(h,"]")),this.getValueAtAddress(a,h)}if(i.length==t.length){var d=t.indexOf("["),p=t.indexOf("]"),y=t.indexOf("{}"),g=t.indexOf("(");if(g>0&&o.DataFormat.stringCountEnclosures(t)>0){var b=t.substring(0,g).trim();if("function"==!_typeof(e[b]))return!1;var v=o.DataFormat.stringGetSegments(o.DataFormat.stringGetEnclosureValueByIndex(t.substring(b.length),0),",");if(0==v.length||""==v[0])return e[b].apply(e);for(var A=[],j=void 0===s?e:s,m=0;m<v.length;m++)!(v[m].length>=2)||'"'!=v[m].charAt(0)&&"'"!=v[m].charAt(0)&&"`"!=v[m].charAt(0)||'"'!=v[m].charAt(v[m].length-1)&&"'"!=v[m].charAt(v[m].length-1)&&"`"!=v[m].charAt(v[m].length-1)?A.push(this.getValueAtAddress(j,v[m])):A.push(v[m].substring(1,v[m].length-1));return e[b].apply(e,A)}if(d>0&&p>d&&p-d>1){var _=t.substring(0,d).trim();if("object"!==_typeof(e[_]))return;var C=t.substring(d+1,p).trim(),O=parseInt(C,10);if(Array.isArray(e[_])==isNaN(O))return;return isNaN(O)?(C=this.cleanWrapCharacters('"',C),C=this.cleanWrapCharacters("`",C),C=this.cleanWrapCharacters("'",C),e[_][C]):e[_][O]}if(d>0&&p>d&&p-d==1){var E=t.substring(0,d).trim();if(!Array.isArray(e[E]))return!1;for(var T=e[E],D=[],k=0;k<T.length;k++){this.checkRecordFilters(t,T[k])&&D.push(T[k])}return D}if(y>0){var x=t.substring(0,y).trim();return"object"==_typeof(e[x])&&e[x]}return null!=_typeof(e[t])?e[t]:void 0}var V=i,M=t.substring(i.length+1),S=V.indexOf("["),N=V.indexOf("]"),w=V.indexOf("(");if(w>0&&o.DataFormat.stringCountEnclosures(V)>0){var H=V.substring(0,w).trim();if(n="".concat(n).concat(n.length>0?".":"").concat(V),"function"==!_typeof(e[H]))return!1;var P=o.DataFormat.stringGetSegments(o.DataFormat.stringGetEnclosureValueByIndex(V.substring(H.length),0),",");if(0==P.length||""==P[0])return this.getValueAtAddress(e[H].apply(e),M,n,a);for(var I=[],F=void 0===s?e:s,W=0;W<P.length;W++)!(P[W].length>=2)||'"'!=P[W].charAt(0)&&"'"!=P[W].charAt(0)&&"`"!=P[W].charAt(0)||'"'!=P[W].charAt(P[W].length-1)&&"'"!=P[W].charAt(P[W].length-1)&&"`"!=P[W].charAt(P[W].length-1)?I.push(this.getValueAtAddress(F,P[W])):I.push(P[W].substring(1,P[W].length-1));return this.getValueAtAddress(e[H].apply(e,I),M,n,F)}if(S>0&&N>S&&N-S>1){var R=V.substring(0,S).trim(),L=V.substring(S+1,N).trim(),G=parseInt(L,10);if(Array.isArray(e[R])==isNaN(G))return;if("object"!=_typeof(e[R]))return;return isNaN(G)?(L=this.cleanWrapCharacters('"',L),L=this.cleanWrapCharacters("`",L),L=this.cleanWrapCharacters("'",L),n="".concat(n).concat(n.length>0?".":"").concat(V),this.getValueAtAddress(e[R][L],M,n,a)):(n="".concat(n).concat(n.length>0?".":"").concat(V),this.getValueAtAddress(e[R][G],M,n,a))}if(S>0&&N>S&&N-S==1){var J=t.substring(0,S).trim();if(!Array.isArray(e[J]))return!1;var B=e[J];n="".concat(n).concat(n.length>0?".":"").concat(J);for(var U={},z=0;z<B.length;z++){var q="".concat(n,"[").concat(z,"]"),K=this.getValueAtAddress(e[J][z],M,q,a);U["".concat(q,".").concat(M)]=K}return U}var Q=t.indexOf("{}");if(Q>0){var X=t.substring(0,Q).trim();if("object"!=_typeof(e[X]))return!1;var $=e[X],Y=Object.keys($);n="".concat(n).concat(n.length>0?".":"").concat(X);for(var Z={},ee=0;ee<Y.length;ee++){var te="".concat(n,".").concat(Y[ee]),re=this.getValueAtAddress(e[X][Y[ee]],M,te,a);this.checkRecordFilters(t,re)&&(Z["".concat(te,".").concat(M)]=re)}return Z}return V in e&&"object"!==_typeof(e[V])?void 0:V in e?(n="".concat(n).concat(n.length>0?".":"").concat(V),this.getValueAtAddress(e[V],M,n,a)):(n="".concat(n).concat(n.length>0?".":"").concat(V),e[V]={},this.getValueAtAddress(e[V],M,n,a))}}}])}();t.exports=i},{"../source/Manyfest-ParseConditionals.js":11,"./Manyfest-CleanWrapCharacters.js":2,"./Manyfest-LogToConsole.js":4,"./Manyfest-ObjectAddress-Parser.js":8}],8:[function(e,t,r){t.exports={stringCountSegments:function(e,t,r,s){var n="string"==typeof e?e:"",a="string"==typeof t?t:".",o="object"==_typeof(r)?pEnclosureStart:{"{":0,"[":1,"(":2},i="object"==_typeof(s)?pEnclosureEnd:{"}":0,"]":1,")":2};if(e.length<1)return 0;for(var c=1,l=[],u=0;u<n.length;u++)n[u]==a&&0==l.length?c++:n[u]in o?l.push(o[n[u]]):n[u]in i&&i[n[u]]==l[l.length-1]&&l.pop();return c},stringGetFirstSegment:function(e,t,r,s){var n="string"==typeof e?e:"",a="string"==typeof t?t:".",o="object"==_typeof(r)?pEnclosureStart:{"{":0,"[":1,"(":2},i="object"==_typeof(s)?pEnclosureEnd:{"}":0,"]":1,")":2};if(e.length<1)return 0;for(var c=[],l=0;l<n.length;l++){if(n[l]==a&&0==c.length)return n.substring(0,l);n[l]in o?c.push(o[n[l]]):n[l]in i&&i[n[l]]==c[c.length-1]&&c.pop()}return n},stringGetSegments:function(e,t,r,s){var n="string"==typeof e?e:"",a="string"==typeof t?t:".",o="object"==_typeof(r)?pEnclosureStart:{"{":0,"[":1,"(":2},i="object"==_typeof(s)?pEnclosureEnd:{"}":0,"]":1,")":2},c=0,l=[];if(e.length<1)return l;for(var u=[],f=0;f<n.length;f++)n[f]==a&&0==u.length?(l.push(n.substring(c,f)),c=f+1):n[f]in o?u.push(o[n[f]]):n[f]in i&&i[n[f]]==u[u.length-1]&&u.pop();return c<n.length&&l.push(n.substring(c)),l},stringCountEnclosures:function(e,t,r){for(var s="string"==typeof e?e:"",n="string"==typeof t?t:"(",a="string"==typeof r?r:")",o=0,i=0,c=0;c<s.length;c++)s[c]==n?(0==i&&o++,i++):s[c]==a&&i--;return o},stringGetEnclosureValueByIndex:function(e,t,r,s){for(var n="string"==typeof e?e:"",a="number"==typeof t?t:0,o="string"==typeof r?r:"(",i="string"==typeof s?s:")",c=0,l=0,u=!1,f=0,h=0,d=0;d<n.length;d++)n[d]==o?1==++l&&a==++c-1&&(u=!0,f=d):n[d]==i&&0==--l&&u&&h<=f&&(h=d,u=!1);return c<=a?"":h>0&&h>f?n.substring(f+1,h):n.substring(f+1)}}},{}],9:[function(e,t,r){var s=e("./Manyfest-LogToConsole.js"),n=e("./Manyfest-CleanWrapCharacters.js"),a=function(){return _createClass((function e(t,r){_classCallCheck(this,e),this.logInfo="function"==typeof t?t:s,this.logError="function"==typeof r?r:s,this.cleanWrapCharacters=n}),[{key:"setValueAtAddress",value:function(e,t,r){if("object"!=_typeof(e))return!1;if("string"!=typeof t)return!1;var s=t.indexOf(".");if(-1==s){var n=t.indexOf("["),a=t.indexOf("]");if(n>0&&a>n&&a-n>1){var o=t.substring(0,n).trim();if("object"!==_typeof(e[o]))return!1;var i=t.substring(n+1,a).trim(),c=parseInt(i,10);return Array.isArray(e[o])!=isNaN(c)&&(isNaN(c)?(i=this.cleanWrapCharacters('"',i),i=this.cleanWrapCharacters("`",i),i=this.cleanWrapCharacters("'",i),e[o][i]=r,!0):(e[o][c]=r,!0))}return e[t]=r,!0}var l=t.substring(0,s),u=t.substring(s+1),f=l.indexOf("["),h=l.indexOf("]");if(f>0&&h>f&&h-f>1){var d=l.substring(0,f).trim(),p=l.substring(f+1,h).trim(),y=parseInt(p,10);return Array.isArray(e[d])!=isNaN(y)&&(isNaN(y)?(p=this.cleanWrapCharacters('"',p),p=this.cleanWrapCharacters("`",p),p=this.cleanWrapCharacters("'",p),this.setValueAtAddress(e[d][p],u,r)):this.setValueAtAddress(e[d][y],u,r))}return l in e&&"object"!==_typeof(e[l])?("__ERROR"in e||(e.__ERROR={}),e.__ERROR[t]=r,!1):(l in e||(e[l]={}),this.setValueAtAddress(e[l],u,r))}}])}();t.exports=a},{"./Manyfest-CleanWrapCharacters.js":2,"./Manyfest-LogToConsole.js":4}],10:[function(e,t,r){var s=e("./Manyfest-LogToConsole.js"),n=function(){return _createClass((function e(t,r){_classCallCheck(this,e),this.logInfo="function"==typeof t?t:s,this.logError="function"==typeof r?r:s}),[{key:"generateAddressses",value:function(e,t,r){var s="string"==typeof t?t:"",n="object"==_typeof(r)?r:{},a=_typeof(e),o={Address:s,Hash:s,Name:s,InSchema:!1};switch("object"==a&&null==e&&(a="null"),a){case"string":o.DataType="String",o.Default=e,n[s]=o;break;case"number":case"bigint":o.DataType="Number",o.Default=e,n[s]=o;break;case"undefined":case"null":o.DataType="Any",o.Default=e,n[s]=o;break;case"object":if(Array.isArray(e)){o.DataType="Array",""!=s&&(n[s]=o);for(var i=0;i<e.length;i++)this.generateAddressses(e[i],"".concat(s,"[").concat(i,"]"),n)}else{o.DataType="Object",""!=s&&(n[s]=o,s+=".");for(var c=Object.keys(e),l=0;l<c.length;l++)this.generateAddressses(e[c[l]],"".concat(s).concat(c[l]),n)}}return n}}])}();t.exports=n},{"./Manyfest-LogToConsole.js":4}],11:[function(e,t,r){var s="<<~?",n="?~>>",a=function(e,t,r,s,n){switch(s){case"TRUE":return!0===e.getValueAtAddress(t,r);case"FALSE":return!1===e.getValueAtAddress(t,r);case"LNGT":case"LENGTH_GREATER_THAN":switch(_typeof(e.getValueAtAddress(t,r))){case"string":case"object":return e.getValueAtAddress(t,r).length>n;default:return!1}break;case"LNLT":case"LENGTH_LESS_THAN":switch(_typeof(e.getValueAtAddress(t,r))){case"string":case"object":return e.getValueAtAddress(t,r).length<n;default:return!1}break;case"!=":return e.getValueAtAddress(t,r)!=n;case"<":return e.getValueAtAddress(t,r)<n;case">":return e.getValueAtAddress(t,r)>n;case"<=":return e.getValueAtAddress(t,r)<=n;case">=":return e.getValueAtAddress(t,r)>=n;case"===":return e.getValueAtAddress(t,r)===n;default:return e.getValueAtAddress(t,r)==n}};t.exports=function(e,t,r){for(var o=!0,i=t.indexOf(s);-1!=i;){var c=t.indexOf(n,i+4);if(-1!=c){var l=t.substring(i+4,c).split(","),u=l[0],f="EXISTS";l.length>1&&(f=l[1]);var h=!1;l.length>2&&(h=l[2]),o=o&&a(e,r,u,f,h),i=t.indexOf(s,c+4)}else i=-1}return o}},{}],12:[function(e,t,r){var s=e("./Manyfest-LogToConsole.js"),n=function(){return _createClass((function e(t,r){_classCallCheck(this,e),this.logInfo="function"==typeof t?t:s,this.logError="function"==typeof r?r:s}),[{key:"resolveAddressMappings",value:function(e,t){if("object"!=_typeof(e))return this.logError("Attempted to resolve address mapping but the descriptor was not an object."),!1;if("object"!=_typeof(t))return!0;var r=Object.keys(e),s={};return r.forEach((function(t){"Hash"in e[t]&&(s[e[t].Hash]=t)})),Object.keys(t).forEach((function(r){var n=t[r],a=!1,o=!1;r in e?a=r:r in s&&(a=s[r]),a?(o=e[a],delete e[a]):o={Hash:r},e[n]=o})),!0}},{key:"safeResolveAddressMappings",value:function(e,t){var r=JSON.parse(JSON.stringify(e));return this.resolveAddressMappings(r,t),r}},{key:"mergeAddressMappings",value:function(e,t){if("object"!=_typeof(t)||"object"!=_typeof(e))return this.logError("Attempted to merge two schema descriptors but both were not objects."),!1;var r=JSON.parse(JSON.stringify(t)),s=JSON.parse(JSON.stringify(e));return Object.keys(r).forEach((function(e){e in s||(s[e]=r[e])})),s}}])}();t.exports=n},{"./Manyfest-LogToConsole.js":4}],13:[function(e,t,r){var s=e("fable-serviceproviderbase"),n=e("./Manyfest-LogToConsole.js"),a=e("./Manyfest-HashTranslation.js"),o=e("./Manyfest-ObjectAddress-CheckAddressExists.js"),i=e("./Manyfest-ObjectAddress-GetValue.js"),c=e("./Manyfest-ObjectAddress-SetValue.js"),l=e("./Manyfest-ObjectAddress-DeleteValue.js"),u=e("./Manyfest-ObjectAddressGeneration.js"),f=e("./Manyfest-SchemaManipulation.js"),h={Scope:"DEFAULT",Descriptors:{}},d=function(e){function t(e,r,s){var h;return _classCallCheck(this,t),(h=_callSuper(this,t,void 0===e?[{}]:[e,r,s])).serviceType="Manifest",h.logInfo=n,h.logError=n,h.objectAddressCheckAddressExists=new o(h.logInfo,h.logError),h.objectAddressGetValue=new i(h.logInfo,h.logError),h.objectAddressSetValue=new c(h.logInfo,h.logError),h.objectAddressDeleteValue=new l(h.logInfo,h.logError),"defaultValues"in h.options||(h.options.defaultValues={String:"",Number:0,Float:0,Integer:0,PreciseNumber:"0.0",Boolean:!1,Binary:0,DateTime:0,Array:[],Object:{},Null:null}),"strict"in h.options||(h.options.strict=!1),h.scope=void 0,h.elementAddresses=void 0,h.elementHashes=void 0,h.elementDescriptors=void 0,h.reset(),"object"===_typeof(h.options)&&h.loadManifest(h.options),h.schemaManipulations=new f(h.logInfo,h.logError),h.objectAddressGeneration=new u(h.logInfo,h.logError),h.hashTranslations=new a(h.logInfo,h.logError),h.numberRegex=/^[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$/,_assertThisInitialized(h)}return _inherits(t,e),_createClass(t,[{key:"reset",value:function(){this.scope="DEFAULT",this.elementAddresses=[],this.elementHashes={},this.elementDescriptors={}}},{key:"clone",value:function(){var e=JSON.parse(JSON.stringify(this.options)),r=new t(this.getManifest(),this.logInfo,this.logError,e);return r.hashTranslations.addTranslation(this.hashTranslations.translationTable),r}},{key:"deserialize",value:function(e){return this.loadManifest(JSON.parse(e))}},{key:"loadManifest",value:function(e){"object"!==_typeof(e)&&this.logError("(".concat(this.scope,") Error loading manifest; expecting an object but parameter was type ").concat(_typeof(e),"."));for(var t="object"==_typeof(e)?e:{},r=Object.keys(h),s=0;s<r.length;s++)r[s]in t||(t[r[s]]=JSON.parse(JSON.stringify(h[r[s]])));if("Scope"in t?"string"==typeof t.Scope?this.scope=t.Scope:this.logError("(".concat(this.scope,") Error loading scope from manifest; expecting a string but property was type ").concat(_typeof(t.Scope),"."),t):this.logError("(".concat(this.scope,') Error loading scope from manifest object. Property "Scope" does not exist in the root of the object.'),t),"Descriptors"in t)if("object"===_typeof(t.Descriptors))for(var n=Object.keys(t.Descriptors),a=0;a<n.length;a++)this.addDescriptor(n[a],t.Descriptors[n[a]]);else this.logError("(".concat(this.scope,") Error loading description object from manifest object. Expecting an object in 'Manifest.Descriptors' but the property was type ").concat(_typeof(t.Descriptors),"."),t);else this.logError("(".concat(this.scope,') Error loading object description from manifest object. Property "Descriptors" does not exist in the root of the Manifest object.'),t);if("HashTranslations"in t&&"object"===_typeof(t.HashTranslations))for(var o=0;o<t.HashTranslations.length;o++);}},{key:"serialize",value:function(){return JSON.stringify(this.getManifest())}},{key:"getManifest",value:function(){return{Scope:this.scope,Descriptors:JSON.parse(JSON.stringify(this.elementDescriptors)),HashTranslations:JSON.parse(JSON.stringify(this.hashTranslations.translationTable))}}},{key:"addDescriptor",value:function(e,t){return"object"===_typeof(t)?("Address"in t||(t.Address=e),e in this.elementDescriptors||this.elementAddresses.push(e),this.elementDescriptors[e]=t,this.elementHashes[e]=e,"Hash"in t?this.elementHashes[t.Hash]=e:t.Hash=e,!0):(this.logError("(".concat(this.scope,") Error loading object descriptor for address '").concat(e,"' from manifest object. Expecting an object but property was type ").concat(_typeof(t),".")),!1)}},{key:"getDescriptorByHash",value:function(e){return this.getDescriptor(this.resolveHashAddress(e))}},{key:"getDescriptor",value:function(e){return this.elementDescriptors[e]}},{key:"eachDescriptor",value:function(e){for(var t=Object.keys(this.elementDescriptors),r=0;r<t.length;r++)e(this.elementDescriptors[t[r]])}},{key:"checkAddressExistsByHash",value:function(e,t){return this.checkAddressExists(e,this.resolveHashAddress(t))}},{key:"checkAddressExists",value:function(e,t){return this.objectAddressCheckAddressExists.checkAddressExists(e,t)}},{key:"resolveHashAddress",value:function(e){var t=e in this.elementHashes,r=e in this.hashTranslations.translationTable;return t&&!r?this.elementHashes[e]:r&&this.hashTranslations.translate(e)in this.elementHashes?this.elementHashes[this.hashTranslations.translate(e)]:r?this.hashTranslations.translate(e):e}},{key:"getValueByHash",value:function(e,t){var r=this.getValueAtAddress(e,this.resolveHashAddress(t));return void 0===r&&(r=this.getDefaultValue(this.getDescriptorByHash(t))),r}},{key:"getValueAtAddress",value:function(e,t){var r=this.objectAddressGetValue.getValueAtAddress(e,t);return void 0===r&&(r=this.getDefaultValue(this.getDescriptor(t))),r}},{key:"setValueByHash",value:function(e,t,r){return this.setValueAtAddress(e,this.resolveHashAddress(t),r)}},{key:"setValueAtAddress",value:function(e,t,r){return this.objectAddressSetValue.setValueAtAddress(e,t,r)}},{key:"deleteValueByHash",value:function(e,t,r){return this.deleteValueAtAddress(e,this.resolveHashAddress(t),r)}},{key:"deleteValueAtAddress",value:function(e,t,r){return this.objectAddressDeleteValue.deleteValueAtAddress(e,t,r)}},{key:"validate",value:function(e){var t={Error:null,Errors:[],MissingElements:[]};"object"!==_typeof(e)&&(t.Error=!0,t.Errors.push("Expected passed in object to be type object but was passed in ".concat(_typeof(e))));for(var r=function(e,r){t.Error=!0,t.Errors.push('Element at address "'.concat(e,'" ').concat(r,"."))},s=0;s<this.elementAddresses.length;s++){var n=this.getDescriptor(this.elementAddresses[s]),a=this.checkAddressExists(e,n.Address),o=this.getValueAtAddress(e,n.Address);if(void 0!==o&&a||(t.MissingElements.push(n.Address),(n.Required||this.options.strict)&&r(n.Address,"is flagged REQUIRED but is not set in the object")),n.DataType){var i=_typeof(o);switch(n.DataType.toString().trim().toLowerCase()){case"string":"string"!=i&&r(n.Address,"has a DataType ".concat(n.DataType," but is of the type ").concat(i));break;case"precisenumber":"string"!=i?r(n.Address,"has a DataType ".concat(n.DataType," but is of the type ").concat(i)):this.numberRegex.test(o)||r(n.Address,"has a DataType ".concat(n.DataType," but is not a valid number"));break;case"number":"number"!=i&&r(n.Address,"has a DataType ".concat(n.DataType," but is of the type ").concat(i));break;case"integer":if("number"!=i)r(n.Address,"has a DataType ".concat(n.DataType," but is of the type ").concat(i));else o.toString().indexOf(".")>-1&&r(n.Address,"has a DataType ".concat(n.DataType," but has a decimal point in the number."));break;case"float":"number"!=i&&r(n.Address,"has a DataType ".concat(n.DataType," but is of the type ").concat(i));break;case"datetime":"Invalid Date"==new Date(o).toString()&&r(n.Address,"has a DataType ".concat(n.DataType," but is not parsable as a Date by Javascript"));default:"string"!=i&&r(n.Address,"has a DataType ".concat(n.DataType," (which auto-converted to String because it was unrecognized) but is of the type ").concat(i))}}}return t}},{key:"getDefaultValue",value:function(e){if("object"==_typeof(e)){if("Default"in e)return e.Default;var t="DataType"in e?e.DataType:"String";return t in this.options.defaultValues?this.options.defaultValues[t]:null}}},{key:"populateDefaults",value:function(e,t){return this.populateObject(e,t,(function(e){return"Default"in e}))}},{key:"populateObject",value:function(e,t,r){var s=this,n="object"===_typeof(e)?e:{},a=void 0!==t&&t,o="function"==typeof r?r:function(e){return!0};return this.elementAddresses.forEach((function(e){var t=s.getDescriptor(e);o(t)&&(!a&&s.checkAddressExists(n,e)||s.setValueAtAddress(n,e,s.getDefaultValue(t)))})),n}}])}(s);t.exports=d},{"./Manyfest-HashTranslation.js":3,"./Manyfest-LogToConsole.js":4,"./Manyfest-ObjectAddress-CheckAddressExists.js":5,"./Manyfest-ObjectAddress-DeleteValue.js":6,"./Manyfest-ObjectAddress-GetValue.js":7,"./Manyfest-ObjectAddress-SetValue.js":9,"./Manyfest-ObjectAddressGeneration.js":10,"./Manyfest-SchemaManipulation.js":12,"fable-serviceproviderbase":1}]},{},[13])(13)})); | ||
//# sourceMappingURL=manyfest.compatible.min.js.map |
@@ -1,2 +0,2 @@ | ||
"use strict";function _defineProperty(t,e,s){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"==typeof e?e:e+""}function _toPrimitive(t,e){if("object"!=typeof t||!t)return t;var s=t[Symbol.toPrimitive];if(void 0!==s){var r=s.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Manyfest=t()}}((function(){return function t(e,s,r){function n(i,o){if(!s[i]){if(!e[i]){var c="function"==typeof require&&require;if(!o&&c)return c(i,!0);if(a)return a(i,!0);var l=new Error("Cannot find module '"+i+"'");throw l.code="MODULE_NOT_FOUND",l}var h=s[i]={exports:{}};e[i][0].call(h.exports,(function(t){return n(e[i][1][t]||t)}),h,h.exports,t,e,s,r)}return s[i].exports}for(var a="function"==typeof require&&require,i=0;i<r.length;i++)n(r[i]);return n}({1:[function(t,e,s){class r{constructor(t,e,s){"object"==typeof t&&t.isFable?this.connectFable(t):this.fable=!1,this.fable?(this.UUID=t.getUUID(),this.options="object"==typeof e?e:{}):(this.options="object"!=typeof t||t.isFable?"object"==typeof e?e:{}:t,this.UUID="CORE-SVC-".concat(Math.floor(89999*Math.random()+1e4))),this.serviceType="Unknown-".concat(this.UUID),this.Hash="string"==typeof s?s:this.fable||"string"!=typeof e?"".concat(this.UUID):e}connectFable(t){if("object"!=typeof t||!t.isFable){let e="Fable Service Provider Base: Cannot connect to Fable, invalid Fable object passed in. The pFable parameter was a [".concat(typeof t,"].}");return console.log(e),new Error(e)}return this.fable||(this.fable=t),this.log||(this.log=this.fable.Logging),this.services||(this.services=this.fable.services),this.servicesMap||(this.servicesMap=this.fable.servicesMap),!0}}_defineProperty(r,"isFableService",!0),e.exports=r,e.exports.CoreServiceProviderBase=r},{}],2:[function(t,e,s){e.exports=(t,e)=>e.startsWith(t)&&e.endsWith(t)?e.substring(1,e.length-1):e},{}],3:[function(t,e,s){let r=t("./Manyfest-LogToConsole.js");e.exports=class{constructor(t,e){this.logInfo="function"==typeof t?t:r,this.logError="function"==typeof e?e:r,this.translationTable={}}translationCount(){return Object.keys(this.translationTable).length}addTranslation(t){if("object"!=typeof t)return this.logError("Hash translation addTranslation expected a translation be type object but was passed in ".concat(typeof t)),!1;Object.keys(t).forEach((e=>{"string"!=typeof t[e]?this.logError("Hash translation addTranslation expected a translation destination hash for [".concat(e,"] to be a string but the referrant was a ").concat(typeof t[e])):this.translationTable[e]=t[e]}))}removeTranslationHash(t){t in this.translationTable&&delete this.translationTable[t]}removeTranslation(t){if("string"==typeof t)return this.removeTranslationHash(t),!0;if("object"==typeof t){return Object.keys(t).forEach((t=>{this.removeTranslation(t)})),!0}return this.logError("Hash translation removeTranslation expected either a string or an object but the passed-in translation was type ".concat(typeof t)),!1}clearTranslations(){this.translationTable={}}translate(t){return t in this.translationTable?this.translationTable[t]:t}}},{"./Manyfest-LogToConsole.js":4}],4:[function(t,e,s){e.exports=(t,e)=>{let s="string"==typeof t?t:"";console.log("[Manyfest] ".concat(s)),e&&console.log(JSON.stringify(e))}},{}],5:[function(t,e,s){const r=t("./Manyfest-LogToConsole.js"),n=t("./Manyfest-ObjectAddress-GetValue.js");let a={DataFormat:t("./Manyfest-ObjectAddress-Parser.js")};e.exports=class{constructor(){this.getObjectValueClass=new n(r,r)}checkAddressExists(t,e,s){if("object"!=typeof t)return!1;if("string"!=typeof e)return!1;let r=void 0===s?t:s,n=a.DataFormat.stringGetFirstSegment(e);if(n.length==e.length){let s=e.indexOf("["),r=e.indexOf("]"),n=e.indexOf("(");if(n>0&&a.DataFormat.stringCountEnclosures(e)>0){let s=e.substring(0,n).trim();return s in t&&"function"==typeof t[s]}if(s>0&&r>s&&r-s>1){let n=e.substring(0,s).trim();if("object"!=typeof t[n])return!1;let a=e.substring(s+1,r).trim(),i=parseInt(a,10);return Array.isArray(t[n])!=isNaN(i)&&(isNaN(i)?(a=this.cleanWrapCharacters('"',a),a=this.cleanWrapCharacters("`",a),a=this.cleanWrapCharacters("'",a),a in t[n]):i in t[n])}return e in t}{let i=n,o=e.substring(n.length+1),c=i.indexOf("["),l=i.indexOf("]"),h=i.indexOf("(");if(h>0&&a.DataFormat.stringCountEnclosures(i)>0){let e=i.substring(0,h).trim();if("function"==(t[e],!1))return!1;let n=a.DataFormat.stringGetSegments(a.DataFormat.stringGetEnclosureValueByIndex(i.substring(e.length),0),",");if(0==n.length||""==n[0])return this.checkAddressExists(t[e].apply(t),o,r);{let r=[],a=void 0===s?t:s;for(let t=0;t<n.length;t++)r.push(this.getObjectValueClass.getValueAtAddress(a,n[t]));return this.checkAddressExists(t[e].apply(t,r),o,a)}}if(c>0&&l>c&&l-c>1){let e=i.substring(0,c).trim(),s=i.substring(c+1,l).trim(),n=parseInt(s,10);return Array.isArray(t[e])!=isNaN(n)&&(isNaN(n)?(s=this.cleanWrapCharacters('"',s),s=this.cleanWrapCharacters("`",s),s=this.cleanWrapCharacters("'",s),this.checkAddressExists(t[e][s],o,r)):this.checkAddressExists(t[e][n],o,r))}return(!(i in t)||"object"==typeof t[i])&&(i in t||(t[i]={}),this.checkAddressExists(t[i],o,r))}}}},{"./Manyfest-LogToConsole.js":4,"./Manyfest-ObjectAddress-GetValue.js":7,"./Manyfest-ObjectAddress-Parser.js":8}],6:[function(t,e,s){let r=t("./Manyfest-LogToConsole.js"),n=t("./Manyfest-CleanWrapCharacters.js"),a=t("../source/Manyfest-ParseConditionals.js");e.exports=class{constructor(t,e){this.logInfo="function"==typeof t?t:r,this.logError="function"==typeof e?e:r,this.cleanWrapCharacters=n}checkRecordFilters(t,e){return a(this,t,e)}deleteValueAtAddress(t,e,s){if("object"!=typeof t)return;if("string"!=typeof e)return;let r="";"string"==typeof s&&(r=s);let n=e.indexOf(".");if(-1==n){let s=e.indexOf("["),r=e.indexOf("]"),n=e.indexOf("{}");if(s>0&&r>s&&r-s>1){let n=e.substring(0,s).trim();if("object"!=typeof t[n])return!1;let a=e.substring(s+1,r).trim(),i=parseInt(a,10);return Array.isArray(t[n])!=isNaN(i)&&(isNaN(i)?(a=this.cleanWrapCharacters('"',a),a=this.cleanWrapCharacters("`",a),a=this.cleanWrapCharacters("'",a),delete t[n][a],!0):(delete t[n][i],!0))}if(s>0&&r>s&&r-s==1){let r=e.substring(0,s).trim();if(!Array.isArray(t[r]))return!1;let n=t[r];for(let t=n.length-1;t>=0;t--){this.checkRecordFilters(e,n[t])&&n.splice(t,1)}return!0}if(n>0){let s=e.substring(0,n).trim();return"object"==typeof t[s]&&(delete t[s],!0)}return delete t[e],!0}{let s=e.substring(0,n),a=e.substring(n+1),i=s.indexOf("["),o=s.indexOf("]");if(i>0&&o>i&&o-i>1){let e=s.substring(0,i).trim(),n=s.substring(i+1,o).trim(),c=parseInt(n,10);return Array.isArray(t[e])!=isNaN(c)&&("object"==typeof t[e]&&(isNaN(c)?(n=this.cleanWrapCharacters('"',n),n=this.cleanWrapCharacters("`",n),n=this.cleanWrapCharacters("'",n),r="".concat(r).concat(r.length>0?".":"").concat(s),this.deleteValueAtAddress(t[e][n],a,r)):(r="".concat(r).concat(r.length>0?".":"").concat(s),this.deleteValueAtAddress(t[e][c],a,r))))}if(i>0&&o>i&&o-i==1){let s=e.substring(0,i).trim();if(!Array.isArray(t[s]))return!1;let n=t[s];r="".concat(r).concat(r.length>0?".":"").concat(s);let o={};for(let e=0;e<n.length;e++){let n="".concat(r,"[").concat(e,"]"),i=this.deleteValueAtAddress(t[s][e],a,n);o["".concat(n,".").concat(a)]=i}return o}let c=e.indexOf("{}");if(c>0){let s=e.substring(0,c).trim();if("object"!=typeof t[s])return!1;let n=t[s],i=Object.keys(n);r="".concat(r).concat(r.length>0?".":"").concat(s);let o={};for(let n=0;n<i.length;n++){let c="".concat(r,".").concat(i[n]),l=this.deleteValueAtAddress(t[s][i[n]],a,c);this.checkRecordFilters(e,l)&&(o["".concat(c,".").concat(a)]=l)}return o}return s in t&&"object"!=typeof t[s]?void 0:s in t?(r="".concat(r).concat(r.length>0?".":"").concat(s),this.deleteValueAtAddress(t[s],a,r)):(r="".concat(r).concat(r.length>0?".":"").concat(s),t[s]={},this.deleteValueAtAddress(t[s],a,r))}}}},{"../source/Manyfest-ParseConditionals.js":11,"./Manyfest-CleanWrapCharacters.js":2,"./Manyfest-LogToConsole.js":4}],7:[function(t,e,s){let r=t("./Manyfest-LogToConsole.js"),n=t("./Manyfest-CleanWrapCharacters.js"),a=t("../source/Manyfest-ParseConditionals.js"),i={DataFormat:t("./Manyfest-ObjectAddress-Parser.js")};e.exports=class{constructor(t,e){this.logInfo="function"==typeof t?t:r,this.logError="function"==typeof e?e:r,this.cleanWrapCharacters=n}checkRecordFilters(t,e){return a(this,t,e)}getValueAtAddress(t,e,s,r){if("object"!=typeof t)return;if("string"!=typeof e)return;let n="";"string"==typeof s&&(n=s);let a=void 0===r?t:r,o=i.DataFormat.stringGetFirstSegment(e);if(""==o){let t=i.DataFormat.stringGetSegments(n),s=0;for(let t=0;t<e.length&&"."==e.charAt(t);t++)s++;let r=t.length-s;if(r<0)return;{let n=e.slice(s);return r>0&&(n="".concat(t.slice(0,r).join("."),".").concat(n)),this.logInfo("Back-navigation detected. Recursing back to address [".concat(n,"]")),this.getValueAtAddress(a,n)}}if(o.length==e.length){let s=e.indexOf("["),n=e.indexOf("]"),a=e.indexOf("{}"),o=e.indexOf("(");if(o>0&&i.DataFormat.stringCountEnclosures(e)>0){let s=e.substring(0,o).trim();if("function"==(t[s],!1))return!1;let n=i.DataFormat.stringGetSegments(i.DataFormat.stringGetEnclosureValueByIndex(e.substring(s.length),0),",");if(0==n.length||""==n[0])return t[s].apply(t);{let e=[],a=void 0===r?t:r;for(let t=0;t<n.length;t++)!(n[t].length>=2)||'"'!=n[t].charAt(0)&&"'"!=n[t].charAt(0)&&"`"!=n[t].charAt(0)||'"'!=n[t].charAt(n[t].length-1)&&"'"!=n[t].charAt(n[t].length-1)&&"`"!=n[t].charAt(n[t].length-1)?e.push(this.getValueAtAddress(a,n[t])):e.push(n[t].substring(1,n[t].length-1));return t[s].apply(t,e)}}if(s>0&&n>s&&n-s>1){let r=e.substring(0,s).trim();if("object"!=typeof t[r])return;let a=e.substring(s+1,n).trim(),i=parseInt(a,10);if(Array.isArray(t[r])==isNaN(i))return;return isNaN(i)?(a=this.cleanWrapCharacters('"',a),a=this.cleanWrapCharacters("`",a),a=this.cleanWrapCharacters("'",a),t[r][a]):t[r][i]}if(s>0&&n>s&&n-s==1){let r=e.substring(0,s).trim();if(!Array.isArray(t[r]))return!1;let n=t[r],a=[];for(let t=0;t<n.length;t++){this.checkRecordFilters(e,n[t])&&a.push(n[t])}return a}if(a>0){let s=e.substring(0,a).trim();return"object"==typeof t[s]&&t[s]}return null!=typeof t[e]?t[e]:void 0}{let s=o,c=e.substring(o.length+1),l=s.indexOf("["),h=s.indexOf("]"),f=s.indexOf("(");if(f>0&&i.DataFormat.stringCountEnclosures(s)>0){let e=s.substring(0,f).trim();if(n="".concat(n).concat(n.length>0?".":"").concat(s),"function"==(t[e],!1))return!1;let o=i.DataFormat.stringGetSegments(i.DataFormat.stringGetEnclosureValueByIndex(s.substring(e.length),0),",");if(0==o.length||""==o[0])return this.getValueAtAddress(t[e].apply(t),c,n,a);{let s=[],a=void 0===r?t:r;for(let t=0;t<o.length;t++)!(o[t].length>=2)||'"'!=o[t].charAt(0)&&"'"!=o[t].charAt(0)&&"`"!=o[t].charAt(0)||'"'!=o[t].charAt(o[t].length-1)&&"'"!=o[t].charAt(o[t].length-1)&&"`"!=o[t].charAt(o[t].length-1)?s.push(this.getValueAtAddress(a,o[t])):s.push(o[t].substring(1,o[t].length-1));return this.getValueAtAddress(t[e].apply(t,s),c,n,a)}}if(l>0&&h>l&&h-l>1){let e=s.substring(0,l).trim(),r=s.substring(l+1,h).trim(),i=parseInt(r,10);if(Array.isArray(t[e])==isNaN(i))return;if("object"!=typeof t[e])return;return isNaN(i)?(r=this.cleanWrapCharacters('"',r),r=this.cleanWrapCharacters("`",r),r=this.cleanWrapCharacters("'",r),n="".concat(n).concat(n.length>0?".":"").concat(s),this.getValueAtAddress(t[e][r],c,n,a)):(n="".concat(n).concat(n.length>0?".":"").concat(s),this.getValueAtAddress(t[e][i],c,n,a))}if(l>0&&h>l&&h-l==1){let s=e.substring(0,l).trim();if(!Array.isArray(t[s]))return!1;let r=t[s];n="".concat(n).concat(n.length>0?".":"").concat(s);let i={};for(let e=0;e<r.length;e++){let r="".concat(n,"[").concat(e,"]"),o=this.getValueAtAddress(t[s][e],c,r,a);i["".concat(r,".").concat(c)]=o}return i}let u=e.indexOf("{}");if(u>0){let s=e.substring(0,u).trim();if("object"!=typeof t[s])return!1;let r=t[s],i=Object.keys(r);n="".concat(n).concat(n.length>0?".":"").concat(s);let o={};for(let r=0;r<i.length;r++){let l="".concat(n,".").concat(i[r]),h=this.getValueAtAddress(t[s][i[r]],c,l,a);this.checkRecordFilters(e,h)&&(o["".concat(l,".").concat(c)]=h)}return o}return s in t&&"object"!=typeof t[s]?void 0:s in t?(n="".concat(n).concat(n.length>0?".":"").concat(s),this.getValueAtAddress(t[s],c,n,a)):(n="".concat(n).concat(n.length>0?".":"").concat(s),t[s]={},this.getValueAtAddress(t[s],c,n,a))}}}},{"../source/Manyfest-ParseConditionals.js":11,"./Manyfest-CleanWrapCharacters.js":2,"./Manyfest-LogToConsole.js":4,"./Manyfest-ObjectAddress-Parser.js":8}],8:[function(t,e,s){e.exports={stringCountSegments:(t,e,s,r)=>{let n="string"==typeof t?t:"",a="string"==typeof e?e:".",i="object"==typeof s?pEnclosureStart:{"{":0,"[":1,"(":2},o="object"==typeof r?pEnclosureEnd:{"}":0,"]":1,")":2};if(t.length<1)return 0;let c=1,l=[];for(let t=0;t<n.length;t++)n[t]==a&&0==l.length?c++:n[t]in i?l.push(i[n[t]]):n[t]in o&&o[n[t]]==l[l.length-1]&&l.pop();return c},stringGetFirstSegment:(t,e,s,r)=>{let n="string"==typeof t?t:"",a="string"==typeof e?e:".",i="object"==typeof s?pEnclosureStart:{"{":0,"[":1,"(":2},o="object"==typeof r?pEnclosureEnd:{"}":0,"]":1,")":2};if(t.length<1)return 0;let c=[];for(let t=0;t<n.length;t++){if(n[t]==a&&0==c.length)return n.substring(0,t);n[t]in i?c.push(i[n[t]]):n[t]in o&&o[n[t]]==c[c.length-1]&&c.pop()}return n},stringGetSegments:(t,e,s,r)=>{let n="string"==typeof t?t:"",a="string"==typeof e?e:".",i="object"==typeof s?pEnclosureStart:{"{":0,"[":1,"(":2},o="object"==typeof r?pEnclosureEnd:{"}":0,"]":1,")":2},c=0,l=[];if(t.length<1)return l;let h=[];for(let t=0;t<n.length;t++)n[t]==a&&0==h.length?(l.push(n.substring(c,t)),c=t+1):n[t]in i?h.push(i[n[t]]):n[t]in o&&o[n[t]]==h[h.length-1]&&h.pop();return c<n.length&&l.push(n.substring(c)),l},stringCountEnclosures:(t,e,s)=>{let r="string"==typeof t?t:"",n="string"==typeof e?e:"(",a="string"==typeof s?s:")",i=0,o=0;for(let t=0;t<r.length;t++)r[t]==n?(0==o&&i++,o++):r[t]==a&&o--;return i},stringGetEnclosureValueByIndex:(t,e,s,r)=>{let n="string"==typeof t?t:"",a="number"==typeof e?e:0,i="string"==typeof s?s:"(",o="string"==typeof r?r:")",c=0,l=0,h=!1,f=0,u=0;for(let t=0;t<n.length;t++)n[t]==i?(l++,1==l&&(c++,a==c-1&&(h=!0,f=t))):n[t]==o&&(l--,0==l&&h&&u<=f&&(u=t,h=!1));return c<=a?"":u>0&&u>f?n.substring(f+1,u):n.substring(f+1)}}},{}],9:[function(t,e,s){let r=t("./Manyfest-LogToConsole.js"),n=t("./Manyfest-CleanWrapCharacters.js");e.exports=class{constructor(t,e){this.logInfo="function"==typeof t?t:r,this.logError="function"==typeof e?e:r,this.cleanWrapCharacters=n}setValueAtAddress(t,e,s){if("object"!=typeof t)return!1;if("string"!=typeof e)return!1;let r=e.indexOf(".");if(-1==r){let r=e.indexOf("["),n=e.indexOf("]");if(r>0&&n>r&&n-r>1){let a=e.substring(0,r).trim();if("object"!=typeof t[a])return!1;let i=e.substring(r+1,n).trim(),o=parseInt(i,10);return Array.isArray(t[a])!=isNaN(o)&&(isNaN(o)?(i=this.cleanWrapCharacters('"',i),i=this.cleanWrapCharacters("`",i),i=this.cleanWrapCharacters("'",i),t[a][i]=s,!0):(t[a][o]=s,!0))}return t[e]=s,!0}{let n=e.substring(0,r),a=e.substring(r+1),i=n.indexOf("["),o=n.indexOf("]");if(i>0&&o>i&&o-i>1){let e=n.substring(0,i).trim(),r=n.substring(i+1,o).trim(),c=parseInt(r,10);return Array.isArray(t[e])!=isNaN(c)&&(isNaN(c)?(r=this.cleanWrapCharacters('"',r),r=this.cleanWrapCharacters("`",r),r=this.cleanWrapCharacters("'",r),this.setValueAtAddress(t[e][r],a,s)):this.setValueAtAddress(t[e][c],a,s))}return n in t&&"object"!=typeof t[n]?("__ERROR"in t||(t.__ERROR={}),t.__ERROR[e]=s,!1):(n in t||(t[n]={}),this.setValueAtAddress(t[n],a,s))}}}},{"./Manyfest-CleanWrapCharacters.js":2,"./Manyfest-LogToConsole.js":4}],10:[function(t,e,s){let r=t("./Manyfest-LogToConsole.js");e.exports=class{constructor(t,e){this.logInfo="function"==typeof t?t:r,this.logError="function"==typeof e?e:r}generateAddressses(t,e,s){let r="string"==typeof e?e:"",n="object"==typeof s?s:{},a=typeof t,i={Address:r,Hash:r,Name:r,InSchema:!1};switch("object"==a&&null==t&&(a="null"),a){case"string":i.DataType="String",i.Default=t,n[r]=i;break;case"number":case"bigint":i.DataType="Number",i.Default=t,n[r]=i;break;case"undefined":case"null":i.DataType="Any",i.Default=t,n[r]=i;break;case"object":if(Array.isArray(t)){i.DataType="Array",""!=r&&(n[r]=i);for(let e=0;e<t.length;e++)this.generateAddressses(t[e],"".concat(r,"[").concat(e,"]"),n)}else{i.DataType="Object",""!=r&&(n[r]=i,r+=".");let e=Object.keys(t);for(let s=0;s<e.length;s++)this.generateAddressses(t[e[s]],"".concat(r).concat(e[s]),n)}}return n}}},{"./Manyfest-LogToConsole.js":4}],11:[function(t,e,s){const r="<<~?",n="?~>>",a=(t,e,s,r,n)=>{switch(r){case"TRUE":return!0===t.getValueAtAddress(e,s);case"FALSE":return!1===t.getValueAtAddress(e,s);case"LNGT":case"LENGTH_GREATER_THAN":switch(typeof t.getValueAtAddress(e,s)){case"string":case"object":return t.getValueAtAddress(e,s).length>n;default:return!1}break;case"LNLT":case"LENGTH_LESS_THAN":switch(typeof t.getValueAtAddress(e,s)){case"string":case"object":return t.getValueAtAddress(e,s).length<n;default:return!1}break;case"!=":return t.getValueAtAddress(e,s)!=n;case"<":return t.getValueAtAddress(e,s)<n;case">":return t.getValueAtAddress(e,s)>n;case"<=":return t.getValueAtAddress(e,s)<=n;case">=":return t.getValueAtAddress(e,s)>=n;case"===":return t.getValueAtAddress(e,s)===n;default:return t.getValueAtAddress(e,s)==n}};e.exports=(t,e,s)=>{let i=!0,o=e.indexOf(r);for(;-1!=o;){let c=e.indexOf(n,o+4);if(-1!=c){let n=e.substring(o+4,c).split(","),l=n[0],h="EXISTS";n.length>1&&(h=n[1]);let f=!1;n.length>2&&(f=n[2]),i=i&&a(t,s,l,h,f),o=e.indexOf(r,c+4)}else o=-1}return i}},{}],12:[function(t,e,s){let r=t("./Manyfest-LogToConsole.js");e.exports=class{constructor(t,e){this.logInfo="function"==typeof t?t:r,this.logError="function"==typeof e?e:r}resolveAddressMappings(t,e){if("object"!=typeof t)return this.logError("Attempted to resolve address mapping but the descriptor was not an object."),!1;if("object"!=typeof e)return!0;let s=Object.keys(t),r={};return s.forEach((e=>{"Hash"in t[e]&&(r[t[e].Hash]=e)})),Object.keys(e).forEach((s=>{let n=e[s],a=!1,i=!1;s in t?a=s:s in r&&(a=r[s]),a?(i=t[a],delete t[a]):i={Hash:s},t[n]=i})),!0}safeResolveAddressMappings(t,e){let s=JSON.parse(JSON.stringify(t));return this.resolveAddressMappings(s,e),s}mergeAddressMappings(t,e){if("object"!=typeof e||"object"!=typeof t)return this.logError("Attempted to merge two schema descriptors but both were not objects."),!1;let s=JSON.parse(JSON.stringify(e)),r=JSON.parse(JSON.stringify(t));return Object.keys(s).forEach((t=>{t in r||(r[t]=s[t])})),r}}},{"./Manyfest-LogToConsole.js":4}],13:[function(t,e,s){const r=t("fable-serviceproviderbase");let n=t("./Manyfest-LogToConsole.js"),a=t("./Manyfest-HashTranslation.js"),i=t("./Manyfest-ObjectAddress-CheckAddressExists.js"),o=t("./Manyfest-ObjectAddress-GetValue.js"),c=t("./Manyfest-ObjectAddress-SetValue.js"),l=t("./Manyfest-ObjectAddress-DeleteValue.js"),h=t("./Manyfest-ObjectAddressGeneration.js"),f=t("./Manyfest-SchemaManipulation.js");const u={Scope:"DEFAULT",Descriptors:{}};class d extends r{constructor(t,e,s){void 0===t?super({}):super(t,e,s),this.serviceType="Manifest",this.logInfo=n,this.logError=n,this.objectAddressCheckAddressExists=new i(this.logInfo,this.logError),this.objectAddressGetValue=new o(this.logInfo,this.logError),this.objectAddressSetValue=new c(this.logInfo,this.logError),this.objectAddressDeleteValue=new l(this.logInfo,this.logError),"defaultValues"in this.options||(this.options.defaultValues={String:"",Number:0,Float:0,Integer:0,Boolean:!1,Binary:0,DateTime:0,Array:[],Object:{},Null:null}),"strict"in this.options||(this.options.strict=!1),this.scope=void 0,this.elementAddresses=void 0,this.elementHashes=void 0,this.elementDescriptors=void 0,this.reset(),"object"==typeof this.options&&this.loadManifest(this.options),this.schemaManipulations=new f(this.logInfo,this.logError),this.objectAddressGeneration=new h(this.logInfo,this.logError),this.hashTranslations=new a(this.logInfo,this.logError)}reset(){this.scope="DEFAULT",this.elementAddresses=[],this.elementHashes={},this.elementDescriptors={}}clone(){let t=JSON.parse(JSON.stringify(this.options)),e=new d(this.getManifest(),this.logInfo,this.logError,t);return e.hashTranslations.addTranslation(this.hashTranslations.translationTable),e}deserialize(t){return this.loadManifest(JSON.parse(t))}loadManifest(t){"object"!=typeof t&&this.logError("(".concat(this.scope,") Error loading manifest; expecting an object but parameter was type ").concat(typeof t,"."));let e="object"==typeof t?t:{},s=Object.keys(u);for(let t=0;t<s.length;t++)s[t]in e||(e[s[t]]=JSON.parse(JSON.stringify(u[s[t]])));if("Scope"in e?"string"==typeof e.Scope?this.scope=e.Scope:this.logError("(".concat(this.scope,") Error loading scope from manifest; expecting a string but property was type ").concat(typeof e.Scope,"."),e):this.logError("(".concat(this.scope,') Error loading scope from manifest object. Property "Scope" does not exist in the root of the object.'),e),"Descriptors"in e)if("object"==typeof e.Descriptors){let t=Object.keys(e.Descriptors);for(let s=0;s<t.length;s++)this.addDescriptor(t[s],e.Descriptors[t[s]])}else this.logError("(".concat(this.scope,") Error loading description object from manifest object. Expecting an object in 'Manifest.Descriptors' but the property was type ").concat(typeof e.Descriptors,"."),e);else this.logError("(".concat(this.scope,') Error loading object description from manifest object. Property "Descriptors" does not exist in the root of the Manifest object.'),e);if("HashTranslations"in e&&"object"==typeof e.HashTranslations)for(let t=0;t<e.HashTranslations.length;t++);}serialize(){return JSON.stringify(this.getManifest())}getManifest(){return{Scope:this.scope,Descriptors:JSON.parse(JSON.stringify(this.elementDescriptors)),HashTranslations:JSON.parse(JSON.stringify(this.hashTranslations.translationTable))}}addDescriptor(t,e){return"object"==typeof e?("Address"in e||(e.Address=t),t in this.elementDescriptors||this.elementAddresses.push(t),this.elementDescriptors[t]=e,this.elementHashes[t]=t,"Hash"in e?this.elementHashes[e.Hash]=t:e.Hash=t,!0):(this.logError("(".concat(this.scope,") Error loading object descriptor for address '").concat(t,"' from manifest object. Expecting an object but property was type ").concat(typeof e,".")),!1)}getDescriptorByHash(t){return this.getDescriptor(this.resolveHashAddress(t))}getDescriptor(t){return this.elementDescriptors[t]}eachDescriptor(t){let e=Object.keys(this.elementDescriptors);for(let s=0;s<e.length;s++)t(this.elementDescriptors[e[s]])}checkAddressExistsByHash(t,e){return this.checkAddressExists(t,this.resolveHashAddress(e))}checkAddressExists(t,e){return this.objectAddressCheckAddressExists.checkAddressExists(t,e)}resolveHashAddress(t){let e,s=t in this.elementHashes,r=t in this.hashTranslations.translationTable;return e=s&&!r?this.elementHashes[t]:r&&this.hashTranslations.translate(t)in this.elementHashes?this.elementHashes[this.hashTranslations.translate(t)]:r?this.hashTranslations.translate(t):t,e}getValueByHash(t,e){let s=this.getValueAtAddress(t,this.resolveHashAddress(e));return void 0===s&&(s=this.getDefaultValue(this.getDescriptorByHash(e))),s}getValueAtAddress(t,e){let s=this.objectAddressGetValue.getValueAtAddress(t,e);return void 0===s&&(s=this.getDefaultValue(this.getDescriptor(e))),s}setValueByHash(t,e,s){return this.setValueAtAddress(t,this.resolveHashAddress(e),s)}setValueAtAddress(t,e,s){return this.objectAddressSetValue.setValueAtAddress(t,e,s)}deleteValueByHash(t,e,s){return this.deleteValueAtAddress(t,this.resolveHashAddress(e),s)}deleteValueAtAddress(t,e,s){return this.objectAddressDeleteValue.deleteValueAtAddress(t,e,s)}validate(t){let e={Error:null,Errors:[],MissingElements:[]};"object"!=typeof t&&(e.Error=!0,e.Errors.push("Expected passed in object to be type object but was passed in ".concat(typeof t)));let s=(t,s)=>{e.Error=!0,e.Errors.push('Element at address "'.concat(t,'" ').concat(s,"."))};for(let r=0;r<this.elementAddresses.length;r++){let n=this.getDescriptor(this.elementAddresses[r]),a=this.checkAddressExists(t,n.Address),i=this.getValueAtAddress(t,n.Address);if(void 0!==i&&a||(e.MissingElements.push(n.Address),(n.Required||this.options.strict)&&s(n.Address,"is flagged REQUIRED but is not set in the object")),n.DataType){let t=typeof i;switch(n.DataType.toString().trim().toLowerCase()){case"string":"string"!=t&&s(n.Address,"has a DataType ".concat(n.DataType," but is of the type ").concat(t));break;case"number":"number"!=t&&s(n.Address,"has a DataType ".concat(n.DataType," but is of the type ").concat(t));break;case"integer":if("number"!=t)s(n.Address,"has a DataType ".concat(n.DataType," but is of the type ").concat(t));else{i.toString().indexOf(".")>-1&&s(n.Address,"has a DataType ".concat(n.DataType," but has a decimal point in the number."))}break;case"float":"number"!=t&&s(n.Address,"has a DataType ".concat(n.DataType," but is of the type ").concat(t));break;case"DateTime":"Invalid Date"==new Date(i).toString()&&s(n.Address,"has a DataType ".concat(n.DataType," but is not parsable as a Date by Javascript"));default:"string"!=t&&s(n.Address,"has a DataType ".concat(n.DataType," (which auto-converted to String because it was unrecognized) but is of the type ").concat(t))}}}return e}getDefaultValue(t){if("object"==typeof t){if("Default"in t)return t.Default;{let e="DataType"in t?t.DataType:"String";return e in this.options.defaultValues?this.options.defaultValues[e]:null}}}populateDefaults(t,e){return this.populateObject(t,e,(t=>"Default"in t))}populateObject(t,e,s){let r="object"==typeof t?t:{},n=void 0!==e&&e,a="function"==typeof s?s:t=>!0;return this.elementAddresses.forEach((t=>{let e=this.getDescriptor(t);a(e)&&(!n&&this.checkAddressExists(r,t)||this.setValueAtAddress(r,t,this.getDefaultValue(e)))})),r}}e.exports=d},{"./Manyfest-HashTranslation.js":3,"./Manyfest-LogToConsole.js":4,"./Manyfest-ObjectAddress-CheckAddressExists.js":5,"./Manyfest-ObjectAddress-DeleteValue.js":6,"./Manyfest-ObjectAddress-GetValue.js":7,"./Manyfest-ObjectAddress-SetValue.js":9,"./Manyfest-ObjectAddressGeneration.js":10,"./Manyfest-SchemaManipulation.js":12,"fable-serviceproviderbase":1}]},{},[13])(13)})); | ||
"use strict";function _defineProperty(t,e,s){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"==typeof e?e:e+""}function _toPrimitive(t,e){if("object"!=typeof t||!t)return t;var s=t[Symbol.toPrimitive];if(void 0!==s){var r=s.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Manyfest=t()}}((function(){return function t(e,s,r){function n(i,o){if(!s[i]){if(!e[i]){var c="function"==typeof require&&require;if(!o&&c)return c(i,!0);if(a)return a(i,!0);var l=new Error("Cannot find module '"+i+"'");throw l.code="MODULE_NOT_FOUND",l}var h=s[i]={exports:{}};e[i][0].call(h.exports,(function(t){return n(e[i][1][t]||t)}),h,h.exports,t,e,s,r)}return s[i].exports}for(var a="function"==typeof require&&require,i=0;i<r.length;i++)n(r[i]);return n}({1:[function(t,e,s){class r{constructor(t,e,s){"object"==typeof t&&t.isFable?this.connectFable(t):this.fable=!1,this.fable?(this.UUID=t.getUUID(),this.options="object"==typeof e?e:{}):(this.options="object"!=typeof t||t.isFable?"object"==typeof e?e:{}:t,this.UUID="CORE-SVC-".concat(Math.floor(89999*Math.random()+1e4))),this.serviceType="Unknown-".concat(this.UUID),this.Hash="string"==typeof s?s:this.fable||"string"!=typeof e?"".concat(this.UUID):e}connectFable(t){if("object"!=typeof t||!t.isFable){let e="Fable Service Provider Base: Cannot connect to Fable, invalid Fable object passed in. The pFable parameter was a [".concat(typeof t,"].}");return console.log(e),new Error(e)}return this.fable||(this.fable=t),this.log||(this.log=this.fable.Logging),this.services||(this.services=this.fable.services),this.servicesMap||(this.servicesMap=this.fable.servicesMap),!0}}_defineProperty(r,"isFableService",!0),e.exports=r,e.exports.CoreServiceProviderBase=r},{}],2:[function(t,e,s){e.exports=(t,e)=>e.startsWith(t)&&e.endsWith(t)?e.substring(1,e.length-1):e},{}],3:[function(t,e,s){let r=t("./Manyfest-LogToConsole.js");e.exports=class{constructor(t,e){this.logInfo="function"==typeof t?t:r,this.logError="function"==typeof e?e:r,this.translationTable={}}translationCount(){return Object.keys(this.translationTable).length}addTranslation(t){if("object"!=typeof t)return this.logError("Hash translation addTranslation expected a translation be type object but was passed in ".concat(typeof t)),!1;Object.keys(t).forEach((e=>{"string"!=typeof t[e]?this.logError("Hash translation addTranslation expected a translation destination hash for [".concat(e,"] to be a string but the referrant was a ").concat(typeof t[e])):this.translationTable[e]=t[e]}))}removeTranslationHash(t){t in this.translationTable&&delete this.translationTable[t]}removeTranslation(t){if("string"==typeof t)return this.removeTranslationHash(t),!0;if("object"==typeof t){return Object.keys(t).forEach((t=>{this.removeTranslation(t)})),!0}return this.logError("Hash translation removeTranslation expected either a string or an object but the passed-in translation was type ".concat(typeof t)),!1}clearTranslations(){this.translationTable={}}translate(t){return t in this.translationTable?this.translationTable[t]:t}}},{"./Manyfest-LogToConsole.js":4}],4:[function(t,e,s){e.exports=(t,e)=>{let s="string"==typeof t?t:"";console.log("[Manyfest] ".concat(s)),e&&console.log(JSON.stringify(e))}},{}],5:[function(t,e,s){const r=t("./Manyfest-LogToConsole.js"),n=t("./Manyfest-ObjectAddress-GetValue.js");let a={DataFormat:t("./Manyfest-ObjectAddress-Parser.js")};e.exports=class{constructor(){this.getObjectValueClass=new n(r,r)}checkAddressExists(t,e,s){if("object"!=typeof t)return!1;if("string"!=typeof e)return!1;let r=void 0===s?t:s,n=a.DataFormat.stringGetFirstSegment(e);if(n.length==e.length){let s=e.indexOf("["),r=e.indexOf("]"),n=e.indexOf("(");if(n>0&&a.DataFormat.stringCountEnclosures(e)>0){let s=e.substring(0,n).trim();return s in t&&"function"==typeof t[s]}if(s>0&&r>s&&r-s>1){let n=e.substring(0,s).trim();if("object"!=typeof t[n])return!1;let a=e.substring(s+1,r).trim(),i=parseInt(a,10);return Array.isArray(t[n])!=isNaN(i)&&(isNaN(i)?(a=this.cleanWrapCharacters('"',a),a=this.cleanWrapCharacters("`",a),a=this.cleanWrapCharacters("'",a),a in t[n]):i in t[n])}return e in t}{let i=n,o=e.substring(n.length+1),c=i.indexOf("["),l=i.indexOf("]"),h=i.indexOf("(");if(h>0&&a.DataFormat.stringCountEnclosures(i)>0){let e=i.substring(0,h).trim();if("function"==(t[e],!1))return!1;let n=a.DataFormat.stringGetSegments(a.DataFormat.stringGetEnclosureValueByIndex(i.substring(e.length),0),",");if(0==n.length||""==n[0])return this.checkAddressExists(t[e].apply(t),o,r);{let r=[],a=void 0===s?t:s;for(let t=0;t<n.length;t++)r.push(this.getObjectValueClass.getValueAtAddress(a,n[t]));return this.checkAddressExists(t[e].apply(t,r),o,a)}}if(c>0&&l>c&&l-c>1){let e=i.substring(0,c).trim(),s=i.substring(c+1,l).trim(),n=parseInt(s,10);return Array.isArray(t[e])!=isNaN(n)&&(isNaN(n)?(s=this.cleanWrapCharacters('"',s),s=this.cleanWrapCharacters("`",s),s=this.cleanWrapCharacters("'",s),this.checkAddressExists(t[e][s],o,r)):this.checkAddressExists(t[e][n],o,r))}return(!(i in t)||"object"==typeof t[i])&&(i in t||(t[i]={}),this.checkAddressExists(t[i],o,r))}}}},{"./Manyfest-LogToConsole.js":4,"./Manyfest-ObjectAddress-GetValue.js":7,"./Manyfest-ObjectAddress-Parser.js":8}],6:[function(t,e,s){let r=t("./Manyfest-LogToConsole.js"),n=t("./Manyfest-CleanWrapCharacters.js"),a=t("../source/Manyfest-ParseConditionals.js");e.exports=class{constructor(t,e){this.logInfo="function"==typeof t?t:r,this.logError="function"==typeof e?e:r,this.cleanWrapCharacters=n}checkRecordFilters(t,e){return a(this,t,e)}deleteValueAtAddress(t,e,s){if("object"!=typeof t)return;if("string"!=typeof e)return;let r="";"string"==typeof s&&(r=s);let n=e.indexOf(".");if(-1==n){let s=e.indexOf("["),r=e.indexOf("]"),n=e.indexOf("{}");if(s>0&&r>s&&r-s>1){let n=e.substring(0,s).trim();if("object"!=typeof t[n])return!1;let a=e.substring(s+1,r).trim(),i=parseInt(a,10);return Array.isArray(t[n])!=isNaN(i)&&(isNaN(i)?(a=this.cleanWrapCharacters('"',a),a=this.cleanWrapCharacters("`",a),a=this.cleanWrapCharacters("'",a),delete t[n][a],!0):(delete t[n][i],!0))}if(s>0&&r>s&&r-s==1){let r=e.substring(0,s).trim();if(!Array.isArray(t[r]))return!1;let n=t[r];for(let t=n.length-1;t>=0;t--){this.checkRecordFilters(e,n[t])&&n.splice(t,1)}return!0}if(n>0){let s=e.substring(0,n).trim();return"object"==typeof t[s]&&(delete t[s],!0)}return delete t[e],!0}{let s=e.substring(0,n),a=e.substring(n+1),i=s.indexOf("["),o=s.indexOf("]");if(i>0&&o>i&&o-i>1){let e=s.substring(0,i).trim(),n=s.substring(i+1,o).trim(),c=parseInt(n,10);return Array.isArray(t[e])!=isNaN(c)&&("object"==typeof t[e]&&(isNaN(c)?(n=this.cleanWrapCharacters('"',n),n=this.cleanWrapCharacters("`",n),n=this.cleanWrapCharacters("'",n),r="".concat(r).concat(r.length>0?".":"").concat(s),this.deleteValueAtAddress(t[e][n],a,r)):(r="".concat(r).concat(r.length>0?".":"").concat(s),this.deleteValueAtAddress(t[e][c],a,r))))}if(i>0&&o>i&&o-i==1){let s=e.substring(0,i).trim();if(!Array.isArray(t[s]))return!1;let n=t[s];r="".concat(r).concat(r.length>0?".":"").concat(s);let o={};for(let e=0;e<n.length;e++){let n="".concat(r,"[").concat(e,"]"),i=this.deleteValueAtAddress(t[s][e],a,n);o["".concat(n,".").concat(a)]=i}return o}let c=e.indexOf("{}");if(c>0){let s=e.substring(0,c).trim();if("object"!=typeof t[s])return!1;let n=t[s],i=Object.keys(n);r="".concat(r).concat(r.length>0?".":"").concat(s);let o={};for(let n=0;n<i.length;n++){let c="".concat(r,".").concat(i[n]),l=this.deleteValueAtAddress(t[s][i[n]],a,c);this.checkRecordFilters(e,l)&&(o["".concat(c,".").concat(a)]=l)}return o}return s in t&&"object"!=typeof t[s]?void 0:s in t?(r="".concat(r).concat(r.length>0?".":"").concat(s),this.deleteValueAtAddress(t[s],a,r)):(r="".concat(r).concat(r.length>0?".":"").concat(s),t[s]={},this.deleteValueAtAddress(t[s],a,r))}}}},{"../source/Manyfest-ParseConditionals.js":11,"./Manyfest-CleanWrapCharacters.js":2,"./Manyfest-LogToConsole.js":4}],7:[function(t,e,s){let r=t("./Manyfest-LogToConsole.js"),n=t("./Manyfest-CleanWrapCharacters.js"),a=t("../source/Manyfest-ParseConditionals.js"),i={DataFormat:t("./Manyfest-ObjectAddress-Parser.js")};e.exports=class{constructor(t,e){this.logInfo="function"==typeof t?t:r,this.logError="function"==typeof e?e:r,this.cleanWrapCharacters=n}checkRecordFilters(t,e){return a(this,t,e)}getValueAtAddress(t,e,s,r){if("object"!=typeof t)return;if("string"!=typeof e)return;let n="";"string"==typeof s&&(n=s);let a=void 0===r?t:r,o=i.DataFormat.stringGetFirstSegment(e);if(""==o){let t=i.DataFormat.stringGetSegments(n),s=0;for(let t=0;t<e.length&&"."==e.charAt(t);t++)s++;let r=t.length-s;if(r<0)return;{let n=e.slice(s);return r>0&&(n="".concat(t.slice(0,r).join("."),".").concat(n)),this.logInfo("Back-navigation detected. Recursing back to address [".concat(n,"]")),this.getValueAtAddress(a,n)}}if(o.length==e.length){let s=e.indexOf("["),n=e.indexOf("]"),a=e.indexOf("{}"),o=e.indexOf("(");if(o>0&&i.DataFormat.stringCountEnclosures(e)>0){let s=e.substring(0,o).trim();if("function"==(t[s],!1))return!1;let n=i.DataFormat.stringGetSegments(i.DataFormat.stringGetEnclosureValueByIndex(e.substring(s.length),0),",");if(0==n.length||""==n[0])return t[s].apply(t);{let e=[],a=void 0===r?t:r;for(let t=0;t<n.length;t++)!(n[t].length>=2)||'"'!=n[t].charAt(0)&&"'"!=n[t].charAt(0)&&"`"!=n[t].charAt(0)||'"'!=n[t].charAt(n[t].length-1)&&"'"!=n[t].charAt(n[t].length-1)&&"`"!=n[t].charAt(n[t].length-1)?e.push(this.getValueAtAddress(a,n[t])):e.push(n[t].substring(1,n[t].length-1));return t[s].apply(t,e)}}if(s>0&&n>s&&n-s>1){let r=e.substring(0,s).trim();if("object"!=typeof t[r])return;let a=e.substring(s+1,n).trim(),i=parseInt(a,10);if(Array.isArray(t[r])==isNaN(i))return;return isNaN(i)?(a=this.cleanWrapCharacters('"',a),a=this.cleanWrapCharacters("`",a),a=this.cleanWrapCharacters("'",a),t[r][a]):t[r][i]}if(s>0&&n>s&&n-s==1){let r=e.substring(0,s).trim();if(!Array.isArray(t[r]))return!1;let n=t[r],a=[];for(let t=0;t<n.length;t++){this.checkRecordFilters(e,n[t])&&a.push(n[t])}return a}if(a>0){let s=e.substring(0,a).trim();return"object"==typeof t[s]&&t[s]}return null!=typeof t[e]?t[e]:void 0}{let s=o,c=e.substring(o.length+1),l=s.indexOf("["),h=s.indexOf("]"),f=s.indexOf("(");if(f>0&&i.DataFormat.stringCountEnclosures(s)>0){let e=s.substring(0,f).trim();if(n="".concat(n).concat(n.length>0?".":"").concat(s),"function"==(t[e],!1))return!1;let o=i.DataFormat.stringGetSegments(i.DataFormat.stringGetEnclosureValueByIndex(s.substring(e.length),0),",");if(0==o.length||""==o[0])return this.getValueAtAddress(t[e].apply(t),c,n,a);{let s=[],a=void 0===r?t:r;for(let t=0;t<o.length;t++)!(o[t].length>=2)||'"'!=o[t].charAt(0)&&"'"!=o[t].charAt(0)&&"`"!=o[t].charAt(0)||'"'!=o[t].charAt(o[t].length-1)&&"'"!=o[t].charAt(o[t].length-1)&&"`"!=o[t].charAt(o[t].length-1)?s.push(this.getValueAtAddress(a,o[t])):s.push(o[t].substring(1,o[t].length-1));return this.getValueAtAddress(t[e].apply(t,s),c,n,a)}}if(l>0&&h>l&&h-l>1){let e=s.substring(0,l).trim(),r=s.substring(l+1,h).trim(),i=parseInt(r,10);if(Array.isArray(t[e])==isNaN(i))return;if("object"!=typeof t[e])return;return isNaN(i)?(r=this.cleanWrapCharacters('"',r),r=this.cleanWrapCharacters("`",r),r=this.cleanWrapCharacters("'",r),n="".concat(n).concat(n.length>0?".":"").concat(s),this.getValueAtAddress(t[e][r],c,n,a)):(n="".concat(n).concat(n.length>0?".":"").concat(s),this.getValueAtAddress(t[e][i],c,n,a))}if(l>0&&h>l&&h-l==1){let s=e.substring(0,l).trim();if(!Array.isArray(t[s]))return!1;let r=t[s];n="".concat(n).concat(n.length>0?".":"").concat(s);let i={};for(let e=0;e<r.length;e++){let r="".concat(n,"[").concat(e,"]"),o=this.getValueAtAddress(t[s][e],c,r,a);i["".concat(r,".").concat(c)]=o}return i}let u=e.indexOf("{}");if(u>0){let s=e.substring(0,u).trim();if("object"!=typeof t[s])return!1;let r=t[s],i=Object.keys(r);n="".concat(n).concat(n.length>0?".":"").concat(s);let o={};for(let r=0;r<i.length;r++){let l="".concat(n,".").concat(i[r]),h=this.getValueAtAddress(t[s][i[r]],c,l,a);this.checkRecordFilters(e,h)&&(o["".concat(l,".").concat(c)]=h)}return o}return s in t&&"object"!=typeof t[s]?void 0:s in t?(n="".concat(n).concat(n.length>0?".":"").concat(s),this.getValueAtAddress(t[s],c,n,a)):(n="".concat(n).concat(n.length>0?".":"").concat(s),t[s]={},this.getValueAtAddress(t[s],c,n,a))}}}},{"../source/Manyfest-ParseConditionals.js":11,"./Manyfest-CleanWrapCharacters.js":2,"./Manyfest-LogToConsole.js":4,"./Manyfest-ObjectAddress-Parser.js":8}],8:[function(t,e,s){e.exports={stringCountSegments:(t,e,s,r)=>{let n="string"==typeof t?t:"",a="string"==typeof e?e:".",i="object"==typeof s?pEnclosureStart:{"{":0,"[":1,"(":2},o="object"==typeof r?pEnclosureEnd:{"}":0,"]":1,")":2};if(t.length<1)return 0;let c=1,l=[];for(let t=0;t<n.length;t++)n[t]==a&&0==l.length?c++:n[t]in i?l.push(i[n[t]]):n[t]in o&&o[n[t]]==l[l.length-1]&&l.pop();return c},stringGetFirstSegment:(t,e,s,r)=>{let n="string"==typeof t?t:"",a="string"==typeof e?e:".",i="object"==typeof s?pEnclosureStart:{"{":0,"[":1,"(":2},o="object"==typeof r?pEnclosureEnd:{"}":0,"]":1,")":2};if(t.length<1)return 0;let c=[];for(let t=0;t<n.length;t++){if(n[t]==a&&0==c.length)return n.substring(0,t);n[t]in i?c.push(i[n[t]]):n[t]in o&&o[n[t]]==c[c.length-1]&&c.pop()}return n},stringGetSegments:(t,e,s,r)=>{let n="string"==typeof t?t:"",a="string"==typeof e?e:".",i="object"==typeof s?pEnclosureStart:{"{":0,"[":1,"(":2},o="object"==typeof r?pEnclosureEnd:{"}":0,"]":1,")":2},c=0,l=[];if(t.length<1)return l;let h=[];for(let t=0;t<n.length;t++)n[t]==a&&0==h.length?(l.push(n.substring(c,t)),c=t+1):n[t]in i?h.push(i[n[t]]):n[t]in o&&o[n[t]]==h[h.length-1]&&h.pop();return c<n.length&&l.push(n.substring(c)),l},stringCountEnclosures:(t,e,s)=>{let r="string"==typeof t?t:"",n="string"==typeof e?e:"(",a="string"==typeof s?s:")",i=0,o=0;for(let t=0;t<r.length;t++)r[t]==n?(0==o&&i++,o++):r[t]==a&&o--;return i},stringGetEnclosureValueByIndex:(t,e,s,r)=>{let n="string"==typeof t?t:"",a="number"==typeof e?e:0,i="string"==typeof s?s:"(",o="string"==typeof r?r:")",c=0,l=0,h=!1,f=0,u=0;for(let t=0;t<n.length;t++)n[t]==i?(l++,1==l&&(c++,a==c-1&&(h=!0,f=t))):n[t]==o&&(l--,0==l&&h&&u<=f&&(u=t,h=!1));return c<=a?"":u>0&&u>f?n.substring(f+1,u):n.substring(f+1)}}},{}],9:[function(t,e,s){let r=t("./Manyfest-LogToConsole.js"),n=t("./Manyfest-CleanWrapCharacters.js");e.exports=class{constructor(t,e){this.logInfo="function"==typeof t?t:r,this.logError="function"==typeof e?e:r,this.cleanWrapCharacters=n}setValueAtAddress(t,e,s){if("object"!=typeof t)return!1;if("string"!=typeof e)return!1;let r=e.indexOf(".");if(-1==r){let r=e.indexOf("["),n=e.indexOf("]");if(r>0&&n>r&&n-r>1){let a=e.substring(0,r).trim();if("object"!=typeof t[a])return!1;let i=e.substring(r+1,n).trim(),o=parseInt(i,10);return Array.isArray(t[a])!=isNaN(o)&&(isNaN(o)?(i=this.cleanWrapCharacters('"',i),i=this.cleanWrapCharacters("`",i),i=this.cleanWrapCharacters("'",i),t[a][i]=s,!0):(t[a][o]=s,!0))}return t[e]=s,!0}{let n=e.substring(0,r),a=e.substring(r+1),i=n.indexOf("["),o=n.indexOf("]");if(i>0&&o>i&&o-i>1){let e=n.substring(0,i).trim(),r=n.substring(i+1,o).trim(),c=parseInt(r,10);return Array.isArray(t[e])!=isNaN(c)&&(isNaN(c)?(r=this.cleanWrapCharacters('"',r),r=this.cleanWrapCharacters("`",r),r=this.cleanWrapCharacters("'",r),this.setValueAtAddress(t[e][r],a,s)):this.setValueAtAddress(t[e][c],a,s))}return n in t&&"object"!=typeof t[n]?("__ERROR"in t||(t.__ERROR={}),t.__ERROR[e]=s,!1):(n in t||(t[n]={}),this.setValueAtAddress(t[n],a,s))}}}},{"./Manyfest-CleanWrapCharacters.js":2,"./Manyfest-LogToConsole.js":4}],10:[function(t,e,s){let r=t("./Manyfest-LogToConsole.js");e.exports=class{constructor(t,e){this.logInfo="function"==typeof t?t:r,this.logError="function"==typeof e?e:r}generateAddressses(t,e,s){let r="string"==typeof e?e:"",n="object"==typeof s?s:{},a=typeof t,i={Address:r,Hash:r,Name:r,InSchema:!1};switch("object"==a&&null==t&&(a="null"),a){case"string":i.DataType="String",i.Default=t,n[r]=i;break;case"number":case"bigint":i.DataType="Number",i.Default=t,n[r]=i;break;case"undefined":case"null":i.DataType="Any",i.Default=t,n[r]=i;break;case"object":if(Array.isArray(t)){i.DataType="Array",""!=r&&(n[r]=i);for(let e=0;e<t.length;e++)this.generateAddressses(t[e],"".concat(r,"[").concat(e,"]"),n)}else{i.DataType="Object",""!=r&&(n[r]=i,r+=".");let e=Object.keys(t);for(let s=0;s<e.length;s++)this.generateAddressses(t[e[s]],"".concat(r).concat(e[s]),n)}}return n}}},{"./Manyfest-LogToConsole.js":4}],11:[function(t,e,s){const r="<<~?",n="?~>>",a=(t,e,s,r,n)=>{switch(r){case"TRUE":return!0===t.getValueAtAddress(e,s);case"FALSE":return!1===t.getValueAtAddress(e,s);case"LNGT":case"LENGTH_GREATER_THAN":switch(typeof t.getValueAtAddress(e,s)){case"string":case"object":return t.getValueAtAddress(e,s).length>n;default:return!1}break;case"LNLT":case"LENGTH_LESS_THAN":switch(typeof t.getValueAtAddress(e,s)){case"string":case"object":return t.getValueAtAddress(e,s).length<n;default:return!1}break;case"!=":return t.getValueAtAddress(e,s)!=n;case"<":return t.getValueAtAddress(e,s)<n;case">":return t.getValueAtAddress(e,s)>n;case"<=":return t.getValueAtAddress(e,s)<=n;case">=":return t.getValueAtAddress(e,s)>=n;case"===":return t.getValueAtAddress(e,s)===n;default:return t.getValueAtAddress(e,s)==n}};e.exports=(t,e,s)=>{let i=!0,o=e.indexOf(r);for(;-1!=o;){let c=e.indexOf(n,o+4);if(-1!=c){let n=e.substring(o+4,c).split(","),l=n[0],h="EXISTS";n.length>1&&(h=n[1]);let f=!1;n.length>2&&(f=n[2]),i=i&&a(t,s,l,h,f),o=e.indexOf(r,c+4)}else o=-1}return i}},{}],12:[function(t,e,s){let r=t("./Manyfest-LogToConsole.js");e.exports=class{constructor(t,e){this.logInfo="function"==typeof t?t:r,this.logError="function"==typeof e?e:r}resolveAddressMappings(t,e){if("object"!=typeof t)return this.logError("Attempted to resolve address mapping but the descriptor was not an object."),!1;if("object"!=typeof e)return!0;let s=Object.keys(t),r={};return s.forEach((e=>{"Hash"in t[e]&&(r[t[e].Hash]=e)})),Object.keys(e).forEach((s=>{let n=e[s],a=!1,i=!1;s in t?a=s:s in r&&(a=r[s]),a?(i=t[a],delete t[a]):i={Hash:s},t[n]=i})),!0}safeResolveAddressMappings(t,e){let s=JSON.parse(JSON.stringify(t));return this.resolveAddressMappings(s,e),s}mergeAddressMappings(t,e){if("object"!=typeof e||"object"!=typeof t)return this.logError("Attempted to merge two schema descriptors but both were not objects."),!1;let s=JSON.parse(JSON.stringify(e)),r=JSON.parse(JSON.stringify(t));return Object.keys(s).forEach((t=>{t in r||(r[t]=s[t])})),r}}},{"./Manyfest-LogToConsole.js":4}],13:[function(t,e,s){const r=t("fable-serviceproviderbase");let n=t("./Manyfest-LogToConsole.js"),a=t("./Manyfest-HashTranslation.js"),i=t("./Manyfest-ObjectAddress-CheckAddressExists.js"),o=t("./Manyfest-ObjectAddress-GetValue.js"),c=t("./Manyfest-ObjectAddress-SetValue.js"),l=t("./Manyfest-ObjectAddress-DeleteValue.js"),h=t("./Manyfest-ObjectAddressGeneration.js"),f=t("./Manyfest-SchemaManipulation.js");const u={Scope:"DEFAULT",Descriptors:{}};class d extends r{constructor(t,e,s){void 0===t?super({}):super(t,e,s),this.serviceType="Manifest",this.logInfo=n,this.logError=n,this.objectAddressCheckAddressExists=new i(this.logInfo,this.logError),this.objectAddressGetValue=new o(this.logInfo,this.logError),this.objectAddressSetValue=new c(this.logInfo,this.logError),this.objectAddressDeleteValue=new l(this.logInfo,this.logError),"defaultValues"in this.options||(this.options.defaultValues={String:"",Number:0,Float:0,Integer:0,PreciseNumber:"0.0",Boolean:!1,Binary:0,DateTime:0,Array:[],Object:{},Null:null}),"strict"in this.options||(this.options.strict=!1),this.scope=void 0,this.elementAddresses=void 0,this.elementHashes=void 0,this.elementDescriptors=void 0,this.reset(),"object"==typeof this.options&&this.loadManifest(this.options),this.schemaManipulations=new f(this.logInfo,this.logError),this.objectAddressGeneration=new h(this.logInfo,this.logError),this.hashTranslations=new a(this.logInfo,this.logError),this.numberRegex=/^[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$/}reset(){this.scope="DEFAULT",this.elementAddresses=[],this.elementHashes={},this.elementDescriptors={}}clone(){let t=JSON.parse(JSON.stringify(this.options)),e=new d(this.getManifest(),this.logInfo,this.logError,t);return e.hashTranslations.addTranslation(this.hashTranslations.translationTable),e}deserialize(t){return this.loadManifest(JSON.parse(t))}loadManifest(t){"object"!=typeof t&&this.logError("(".concat(this.scope,") Error loading manifest; expecting an object but parameter was type ").concat(typeof t,"."));let e="object"==typeof t?t:{},s=Object.keys(u);for(let t=0;t<s.length;t++)s[t]in e||(e[s[t]]=JSON.parse(JSON.stringify(u[s[t]])));if("Scope"in e?"string"==typeof e.Scope?this.scope=e.Scope:this.logError("(".concat(this.scope,") Error loading scope from manifest; expecting a string but property was type ").concat(typeof e.Scope,"."),e):this.logError("(".concat(this.scope,') Error loading scope from manifest object. Property "Scope" does not exist in the root of the object.'),e),"Descriptors"in e)if("object"==typeof e.Descriptors){let t=Object.keys(e.Descriptors);for(let s=0;s<t.length;s++)this.addDescriptor(t[s],e.Descriptors[t[s]])}else this.logError("(".concat(this.scope,") Error loading description object from manifest object. Expecting an object in 'Manifest.Descriptors' but the property was type ").concat(typeof e.Descriptors,"."),e);else this.logError("(".concat(this.scope,') Error loading object description from manifest object. Property "Descriptors" does not exist in the root of the Manifest object.'),e);if("HashTranslations"in e&&"object"==typeof e.HashTranslations)for(let t=0;t<e.HashTranslations.length;t++);}serialize(){return JSON.stringify(this.getManifest())}getManifest(){return{Scope:this.scope,Descriptors:JSON.parse(JSON.stringify(this.elementDescriptors)),HashTranslations:JSON.parse(JSON.stringify(this.hashTranslations.translationTable))}}addDescriptor(t,e){return"object"==typeof e?("Address"in e||(e.Address=t),t in this.elementDescriptors||this.elementAddresses.push(t),this.elementDescriptors[t]=e,this.elementHashes[t]=t,"Hash"in e?this.elementHashes[e.Hash]=t:e.Hash=t,!0):(this.logError("(".concat(this.scope,") Error loading object descriptor for address '").concat(t,"' from manifest object. Expecting an object but property was type ").concat(typeof e,".")),!1)}getDescriptorByHash(t){return this.getDescriptor(this.resolveHashAddress(t))}getDescriptor(t){return this.elementDescriptors[t]}eachDescriptor(t){let e=Object.keys(this.elementDescriptors);for(let s=0;s<e.length;s++)t(this.elementDescriptors[e[s]])}checkAddressExistsByHash(t,e){return this.checkAddressExists(t,this.resolveHashAddress(e))}checkAddressExists(t,e){return this.objectAddressCheckAddressExists.checkAddressExists(t,e)}resolveHashAddress(t){let e,s=t in this.elementHashes,r=t in this.hashTranslations.translationTable;return e=s&&!r?this.elementHashes[t]:r&&this.hashTranslations.translate(t)in this.elementHashes?this.elementHashes[this.hashTranslations.translate(t)]:r?this.hashTranslations.translate(t):t,e}getValueByHash(t,e){let s=this.getValueAtAddress(t,this.resolveHashAddress(e));return void 0===s&&(s=this.getDefaultValue(this.getDescriptorByHash(e))),s}getValueAtAddress(t,e){let s=this.objectAddressGetValue.getValueAtAddress(t,e);return void 0===s&&(s=this.getDefaultValue(this.getDescriptor(e))),s}setValueByHash(t,e,s){return this.setValueAtAddress(t,this.resolveHashAddress(e),s)}setValueAtAddress(t,e,s){return this.objectAddressSetValue.setValueAtAddress(t,e,s)}deleteValueByHash(t,e,s){return this.deleteValueAtAddress(t,this.resolveHashAddress(e),s)}deleteValueAtAddress(t,e,s){return this.objectAddressDeleteValue.deleteValueAtAddress(t,e,s)}validate(t){let e={Error:null,Errors:[],MissingElements:[]};"object"!=typeof t&&(e.Error=!0,e.Errors.push("Expected passed in object to be type object but was passed in ".concat(typeof t)));let s=(t,s)=>{e.Error=!0,e.Errors.push('Element at address "'.concat(t,'" ').concat(s,"."))};for(let r=0;r<this.elementAddresses.length;r++){let n=this.getDescriptor(this.elementAddresses[r]),a=this.checkAddressExists(t,n.Address),i=this.getValueAtAddress(t,n.Address);if(void 0!==i&&a||(e.MissingElements.push(n.Address),(n.Required||this.options.strict)&&s(n.Address,"is flagged REQUIRED but is not set in the object")),n.DataType){let t=typeof i;switch(n.DataType.toString().trim().toLowerCase()){case"string":"string"!=t&&s(n.Address,"has a DataType ".concat(n.DataType," but is of the type ").concat(t));break;case"precisenumber":"string"!=t?s(n.Address,"has a DataType ".concat(n.DataType," but is of the type ").concat(t)):this.numberRegex.test(i)||s(n.Address,"has a DataType ".concat(n.DataType," but is not a valid number"));break;case"number":"number"!=t&&s(n.Address,"has a DataType ".concat(n.DataType," but is of the type ").concat(t));break;case"integer":if("number"!=t)s(n.Address,"has a DataType ".concat(n.DataType," but is of the type ").concat(t));else{i.toString().indexOf(".")>-1&&s(n.Address,"has a DataType ".concat(n.DataType," but has a decimal point in the number."))}break;case"float":"number"!=t&&s(n.Address,"has a DataType ".concat(n.DataType," but is of the type ").concat(t));break;case"datetime":"Invalid Date"==new Date(i).toString()&&s(n.Address,"has a DataType ".concat(n.DataType," but is not parsable as a Date by Javascript"));default:"string"!=t&&s(n.Address,"has a DataType ".concat(n.DataType," (which auto-converted to String because it was unrecognized) but is of the type ").concat(t))}}}return e}getDefaultValue(t){if("object"==typeof t){if("Default"in t)return t.Default;{let e="DataType"in t?t.DataType:"String";return e in this.options.defaultValues?this.options.defaultValues[e]:null}}}populateDefaults(t,e){return this.populateObject(t,e,(t=>"Default"in t))}populateObject(t,e,s){let r="object"==typeof t?t:{},n=void 0!==e&&e,a="function"==typeof s?s:t=>!0;return this.elementAddresses.forEach((t=>{let e=this.getDescriptor(t);a(e)&&(!n&&this.checkAddressExists(r,t)||this.setValueAtAddress(r,t,this.getDefaultValue(e)))})),r}}e.exports=d},{"./Manyfest-HashTranslation.js":3,"./Manyfest-LogToConsole.js":4,"./Manyfest-ObjectAddress-CheckAddressExists.js":5,"./Manyfest-ObjectAddress-DeleteValue.js":6,"./Manyfest-ObjectAddress-GetValue.js":7,"./Manyfest-ObjectAddress-SetValue.js":9,"./Manyfest-ObjectAddressGeneration.js":10,"./Manyfest-SchemaManipulation.js":12,"fable-serviceproviderbase":1}]},{},[13])(13)})); | ||
//# sourceMappingURL=manyfest.min.js.map |
{ | ||
"name": "manyfest", | ||
"version": "1.0.34", | ||
"version": "1.0.35", | ||
"description": "JSON Object Manifest for Data Description and Parsing", | ||
@@ -5,0 +5,0 @@ "main": "source/Manyfest.js", |
@@ -133,2 +133,3 @@ # Manyfest | ||
Number | A number of any type | ||
PreciseNumber | An arbitrary precision number, stored in a string | ||
Boolean | A boolean value represented by the JSON true or false | ||
@@ -135,0 +136,0 @@ Binary | A boolean value represented as 1 or 0 |
@@ -56,2 +56,3 @@ /** | ||
"Integer": 0, | ||
"PreciseNumber": "0.0", | ||
"Boolean": false, | ||
@@ -86,2 +87,4 @@ "Binary": 0, | ||
this.hashTranslations = new libHashTranslation(this.logInfo, this.logError); | ||
this.numberRegex = /^[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$/; | ||
} | ||
@@ -422,2 +425,13 @@ | ||
case "precisenumber": | ||
if (tmpElementType != 'string') | ||
{ | ||
addValidationError(tmpDescriptor.Address, `has a DataType ${tmpDescriptor.DataType} but is of the type ${tmpElementType}`); | ||
} | ||
else if (!this.numberRegex.test(tmpValue)) | ||
{ | ||
addValidationError(tmpDescriptor.Address, `has a DataType ${tmpDescriptor.DataType} but is not a valid number`); | ||
} | ||
break; | ||
case 'number': | ||
@@ -453,3 +467,3 @@ if (tmpElementType != 'number') | ||
case 'DateTime': | ||
case 'datetime': | ||
let tmpValueDate = new Date(tmpValue); | ||
@@ -456,0 +470,0 @@ if (tmpValueDate.toString() == 'Invalid Date') |
@@ -20,3 +20,4 @@ /** | ||
"IDAnimal": { "Name":"Database ID", "Description":"The unique integer-based database identifier for an Animal record.", "DataType":"Integer" }, | ||
"Name": { "Required":true, "Description":"The animal's colloquial species name (e.g. Rabbit, Dog, Bear, Mongoose)." } | ||
"Name": { "Required":true, "Description":"The animal's colloquial species name (e.g. Rabbit, Dog, Bear, Mongoose)." }, | ||
"Age": { "Required":false, "DataType":"PreciseNumber", "Description":"The animal's age in microseconds." } | ||
} | ||
@@ -79,3 +80,26 @@ }); | ||
); | ||
test | ||
( | ||
'Validate should be able to test for precise numbers.', | ||
(fTestComplete)=> | ||
{ | ||
let animalManyfest = new libManyfest(_AnimalManyfestSchema); | ||
let tmpValidationResults = animalManyfest.validate({IDAnimal:100, Name:"Froggy"}); | ||
Expect(tmpValidationResults.Error).to.equal(null); | ||
// TODO: Should javascript numbers really be illegal in a PreciseNumber? | ||
tmpValidationResults = animalManyfest.validate({IDAnimal:100, Name:"Froggy", "Age": 100}); | ||
Expect(tmpValidationResults.Error).to.equal(true); | ||
Expect(animalManyfest.validate({IDAnimal:100, Name:"Froggy", "Age": "101.5"}).Error).to.equal(null); | ||
Expect(animalManyfest.validate({IDAnimal:100, Name:"Froggy", "Age": "10sss1.1.5"}).Error).to.equal(true); | ||
Expect(animalManyfest.validate({IDAnimal:100, Name:"Froggy", "Age": "101.1.5"}).Error).to.equal(true); | ||
Expect(animalManyfest.validate({IDAnimal:100, Name:"Froggy", "Age": "1.05612e5"}).Error).to.equal(null); | ||
Expect(animalManyfest.validate({IDAnimal:100, Name:"Froggy", "Age": "-1.05612e5"}).Error).to.equal(null); | ||
Expect(animalManyfest.validate({IDAnimal:100, Name:"Froggy", "Age": "+342456732879057432890574189473218947328194728397418932741893274891273849012738947128390526753289104621980563219642154372891433467318946321784321201.54574328954326589467451829047832901473895634178561204732190847327891563421890561234890347289145642389057412389473218945632189473289473218947321894561234890473218947329856123478904723189042758234164123789041"}).Error).to.equal(null); | ||
fTestComplete(); | ||
} | ||
); | ||
} | ||
@@ -82,0 +106,0 @@ ); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
1187090
11179
587