Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

optimal

Package Overview
Dependencies
Maintainers
1
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

optimal - npm Package Compare versions

Comparing version 0.11.0 to 0.12.0

optimal.js.flow

34

lib/Builder.js

@@ -23,2 +23,4 @@ 'use strict';

exports.custom = custom;
var _isObject = require('./isObject');

@@ -122,2 +124,22 @@

}, {
key: 'custom',
value: function custom(callback) {
if ("production" !== process.env.NODE_ENV) {
this.invariant(typeof callback === 'function', 'Custom blueprints require a validation function.');
}
return this.addCheck(this.checkCustom, callback);
}
}, {
key: 'checkCustom',
value: function checkCustom(path, value, callback) {
if ("production" !== process.env.NODE_ENV) {
try {
callback(value, this.currentOptions);
} catch (error) {
this.invariant(false, error.message, path);
}
}
}
}, {
key: 'deprecate',

@@ -282,2 +304,7 @@ value: function deprecate(message) {

}, {
key: 'typeName',
value: function typeName() {
return this.type;
}
}, {
key: 'xor',

@@ -317,2 +344,7 @@ value: function xor() {

exports.default = Builder;
exports.default = Builder;
function custom(callback) {
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
return new Builder('custom', defaultValue).custom(callback);
}

2

lib/bundle.js

@@ -1,1 +0,1 @@

"use strict";function unwrapExports(e){return e&&e.__esModule?e.default:e}function createCommonjsModule(e,t){return t={exports:{}},e(t,t.exports),t.exports}function isObject$1(e){return"object"===(void 0===e?"undefined":_typeof(e))&&null!==e&&!Array.isArray(e)}function array(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return new ArrayBuilder(e,t)}function bool(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new BoolBuilder(e)}function custom(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new CustomBuilder(e,t)}function func(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return new FuncBuilder(e)}function instance(e){return new InstanceBuilder(e)}function regex(){return instance(RegExp)}function date(){return instance(Date)}function number(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new NumberBuilder(e)}function object(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new ObjectBuilder(e,t)}function shape(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new ShapeBuilder(e,t)}function string(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return new StringBuilder(e)}function union(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new UnionBuilder(e,t)}function buildAndCheckOptions(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=_extends$1({},e),i={};return _Object$keys(t).forEach(function(c){var s=t[c],u=n?n+"."+c:c;s instanceof Builder?i[c]=s.runChecks(u,e[c],e,r):isObject$1(s)&&(i[c]=buildAndCheckOptions(e[c]||{},s,r,u)),delete o[c]}),r.unknown&&_Object$assign(i,o),i}function Options(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return buildAndCheckOptions(e,t({array:array,bool:bool,custom:custom,date:date,func:func,instance:instance,number:number,object:object,regex:regex,shape:shape,string:string,union:union}),r)}var _global=createCommonjsModule(function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)}),_core=createCommonjsModule(function(e){var t=e.exports={version:"2.4.0"};"number"==typeof __e&&(__e=t)}),_aFunction=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e},_ctx=function(e,t,r){if(_aFunction(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,o){return e.call(t,r,n,o)}}return function(){return e.apply(t,arguments)}},_isObject=function(e){return"object"==typeof e?null!==e:"function"==typeof e},_anObject=function(e){if(!_isObject(e))throw TypeError(e+" is not an object!");return e},_fails=function(e){try{return!!e()}catch(e){return!0}},_descriptors=!_fails(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),document$1=_global.document,is=_isObject(document$1)&&_isObject(document$1.createElement),_domCreate=function(e){return is?document$1.createElement(e):{}},_ie8DomDefine=!_descriptors&&!_fails(function(){return 7!=Object.defineProperty(_domCreate("div"),"a",{get:function(){return 7}}).a}),_toPrimitive=function(e,t){if(!_isObject(e))return e;var r,n;if(t&&"function"==typeof(r=e.toString)&&!_isObject(n=r.call(e)))return n;if("function"==typeof(r=e.valueOf)&&!_isObject(n=r.call(e)))return n;if(!t&&"function"==typeof(r=e.toString)&&!_isObject(n=r.call(e)))return n;throw TypeError("Can't convert object to primitive value")},dP=Object.defineProperty,f=_descriptors?Object.defineProperty:function(e,t,r){if(_anObject(e),t=_toPrimitive(t,!0),_anObject(r),_ie8DomDefine)try{return dP(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e},_objectDp={f:f},_propertyDesc=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},_hide=_descriptors?function(e,t,r){return _objectDp.f(e,t,_propertyDesc(1,r))}:function(e,t,r){return e[t]=r,e},PROTOTYPE="prototype",$export=function(e,t,r){var n,o,i,c=e&$export.F,s=e&$export.G,u=e&$export.S,a=e&$export.P,l=e&$export.B,f=e&$export.W,_=s?_core:_core[t]||(_core[t]={}),p=_[PROTOTYPE],h=s?_global:u?_global[t]:(_global[t]||{})[PROTOTYPE];s&&(r=t);for(n in r)(o=!c&&h&&void 0!==h[n])&&n in _||(i=o?h[n]:r[n],_[n]=s&&"function"!=typeof h[n]?r[n]:l&&o?_ctx(i,_global):f&&h[n]==i?function(e){var t=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,r)}return new e(t,r,n)}return e.apply(this,arguments)};return t[PROTOTYPE]=e[PROTOTYPE],t}(i):a&&"function"==typeof i?_ctx(Function.call,i):i,a&&((_.virtual||(_.virtual={}))[n]=i,e&$export.R&&p&&!p[n]&&_hide(p,n,i)))};$export.F=1,$export.G=2,$export.S=4,$export.P=8,$export.B=16,$export.W=32,$export.U=64,$export.R=128;var _export=$export,hasOwnProperty={}.hasOwnProperty,_has=function(e,t){return hasOwnProperty.call(e,t)},toString={}.toString,_cof=function(e){return toString.call(e).slice(8,-1)},_iobject=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==_cof(e)?e.split(""):Object(e)},_defined=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e},_toIobject=function(e){return _iobject(_defined(e))},ceil=Math.ceil,floor=Math.floor,_toInteger=function(e){return isNaN(e=+e)?0:(e>0?floor:ceil)(e)},min=Math.min,_toLength=function(e){return e>0?min(_toInteger(e),9007199254740991):0},max=Math.max,min$1=Math.min,_toIndex=function(e,t){return e=_toInteger(e),e<0?max(e+t,0):min$1(e,t)},_arrayIncludes=function(e){return function(t,r,n){var o,i=_toIobject(t),c=_toLength(i.length),s=_toIndex(n,c);if(e&&r!=r){for(;c>s;)if((o=i[s++])!=o)return!0}else for(;c>s;s++)if((e||s in i)&&i[s]===r)return e||s||0;return!e&&-1}},SHARED="__core-js_shared__",store=_global[SHARED]||(_global[SHARED]={}),_shared=function(e){return store[e]||(store[e]={})},id=0,px=Math.random(),_uid=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++id+px).toString(36))},shared=_shared("keys"),_sharedKey=function(e){return shared[e]||(shared[e]=_uid(e))},arrayIndexOf=_arrayIncludes(!1),IE_PROTO=_sharedKey("IE_PROTO"),_objectKeysInternal=function(e,t){var r,n=_toIobject(e),o=0,i=[];for(r in n)r!=IE_PROTO&&_has(n,r)&&i.push(r);for(;t.length>o;)_has(n,r=t[o++])&&(~arrayIndexOf(i,r)||i.push(r));return i},_enumBugKeys="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),_objectKeys=Object.keys||function(e){return _objectKeysInternal(e,_enumBugKeys)},f$1=Object.getOwnPropertySymbols,_objectGops={f:f$1},f$2={}.propertyIsEnumerable,_objectPie={f:f$2},_toObject=function(e){return Object(_defined(e))},$assign=Object.assign,_objectAssign=!$assign||_fails(function(){var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(e){t[e]=e}),7!=$assign({},e)[r]||Object.keys($assign({},t)).join("")!=n})?function(e,t){for(var r=_toObject(e),n=arguments.length,o=1,i=_objectGops.f,c=_objectPie.f;n>o;)for(var s,u=_iobject(arguments[o++]),a=i?_objectKeys(u).concat(i(u)):_objectKeys(u),l=a.length,f=0;l>f;)c.call(u,s=a[f++])&&(r[s]=u[s]);return r}:$assign;_export(_export.S+_export.F,"Object",{assign:_objectAssign});var assign$1=_core.Object.assign,assign=createCommonjsModule(function(e){e.exports={default:assign$1,__esModule:!0}}),_Object$assign=unwrapExports(assign),_objectSap=function(e,t){var r=(_core.Object||{})[e]||Object[e],n={};n[e]=t(r),_export(_export.S+_export.F*_fails(function(){r(1)}),"Object",n)};_objectSap("keys",function(){return function(e){return _objectKeys(_toObject(e))}});var keys$1=_core.Object.keys,keys=createCommonjsModule(function(e){e.exports={default:keys$1,__esModule:!0}}),_Object$keys=unwrapExports(keys),_extends=createCommonjsModule(function(e,t){t.__esModule=!0;var r=function(e){return e&&e.__esModule?e:{default:e}}(assign);t.default=r.default||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}}),_extends$1=unwrapExports(_extends),_stringAt=function(e){return function(t,r){var n,o,i=String(_defined(t)),c=_toInteger(r),s=i.length;return c<0||c>=s?e?"":void 0:(n=i.charCodeAt(c),n<55296||n>56319||c+1===s||(o=i.charCodeAt(c+1))<56320||o>57343?e?i.charAt(c):n:e?i.slice(c,c+2):o-56320+(n-55296<<10)+65536)}},_library=!0,_redefine=_hide,_iterators={},_objectDps=_descriptors?Object.defineProperties:function(e,t){_anObject(e);for(var r,n=_objectKeys(t),o=n.length,i=0;o>i;)_objectDp.f(e,r=n[i++],t[r]);return e},_html=_global.document&&document.documentElement,IE_PROTO$1=_sharedKey("IE_PROTO"),Empty=function(){},PROTOTYPE$1="prototype",createDict=function(){var e,t=_domCreate("iframe"),r=_enumBugKeys.length;for(t.style.display="none",_html.appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),createDict=e.F;r--;)delete createDict[PROTOTYPE$1][_enumBugKeys[r]];return createDict()},_objectCreate=Object.create||function(e,t){var r;return null!==e?(Empty[PROTOTYPE$1]=_anObject(e),r=new Empty,Empty[PROTOTYPE$1]=null,r[IE_PROTO$1]=e):r=createDict(),void 0===t?r:_objectDps(r,t)},_wks=createCommonjsModule(function(e){var t=_shared("wks"),r=_global.Symbol,n="function"==typeof r;(e.exports=function(e){return t[e]||(t[e]=n&&r[e]||(n?r:_uid)("Symbol."+e))}).store=t}),def=_objectDp.f,TAG=_wks("toStringTag"),_setToStringTag=function(e,t,r){e&&!_has(e=r?e:e.prototype,TAG)&&def(e,TAG,{configurable:!0,value:t})},IteratorPrototype={};_hide(IteratorPrototype,_wks("iterator"),function(){return this});var _iterCreate=function(e,t,r){e.prototype=_objectCreate(IteratorPrototype,{next:_propertyDesc(1,r)}),_setToStringTag(e,t+" Iterator")},IE_PROTO$2=_sharedKey("IE_PROTO"),ObjectProto=Object.prototype,_objectGpo=Object.getPrototypeOf||function(e){return e=_toObject(e),_has(e,IE_PROTO$2)?e[IE_PROTO$2]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?ObjectProto:null},ITERATOR=_wks("iterator"),BUGGY=!([].keys&&"next"in[].keys()),FF_ITERATOR="@@iterator",KEYS="keys",VALUES="values",returnThis=function(){return this},_iterDefine=function(e,t,r,n,o,i,c){_iterCreate(r,t,n);var s,u,a,l=function(e){if(!BUGGY&&e in h)return h[e];switch(e){case KEYS:case VALUES:return function(){return new r(this,e)}}return function(){return new r(this,e)}},f=t+" Iterator",_=o==VALUES,p=!1,h=e.prototype,d=h[ITERATOR]||h[FF_ITERATOR]||o&&h[o],y=d||l(o),b=o?_?l("entries"):y:void 0,O="Array"==t?h.entries||d:d;if(O&&(a=_objectGpo(O.call(new e)))!==Object.prototype&&(_setToStringTag(a,f,!0),_library||_has(a,ITERATOR)||_hide(a,ITERATOR,returnThis)),_&&d&&d.name!==VALUES&&(p=!0,y=function(){return d.call(this)}),_library&&!c||!BUGGY&&!p&&h[ITERATOR]||_hide(h,ITERATOR,y),_iterators[t]=y,_iterators[f]=returnThis,o)if(s={values:_?y:l(VALUES),keys:i?y:l(KEYS),entries:b},c)for(u in s)u in h||_redefine(h,u,s[u]);else _export(_export.P+_export.F*(BUGGY||p),t,s);return s},$at=_stringAt(!0);_iterDefine(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,r=this._i;return r>=t.length?{value:void 0,done:!0}:(e=$at(t,r),this._i+=e.length,{value:e,done:!1})});var _iterCall=function(e,t,r,n){try{return n?t(_anObject(r)[0],r[1]):t(r)}catch(t){var o=e.return;throw void 0!==o&&_anObject(o.call(e)),t}},ITERATOR$1=_wks("iterator"),ArrayProto=Array.prototype,_isArrayIter=function(e){return void 0!==e&&(_iterators.Array===e||ArrayProto[ITERATOR$1]===e)},_createProperty=function(e,t,r){t in e?_objectDp.f(e,t,_propertyDesc(0,r)):e[t]=r},TAG$1=_wks("toStringTag"),ARG="Arguments"==_cof(function(){return arguments}()),tryGet=function(e,t){try{return e[t]}catch(e){}},_classof=function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=tryGet(t=Object(e),TAG$1))?r:ARG?_cof(t):"Object"==(n=_cof(t))&&"function"==typeof t.callee?"Arguments":n},ITERATOR$2=_wks("iterator"),core_getIteratorMethod=_core.getIteratorMethod=function(e){if(void 0!=e)return e[ITERATOR$2]||e["@@iterator"]||_iterators[_classof(e)]},ITERATOR$3=_wks("iterator"),SAFE_CLOSING=!1;try{var riter=[7][ITERATOR$3]();riter.return=function(){SAFE_CLOSING=!0},Array.from(riter,function(){throw 2})}catch(e){}var _iterDetect=function(e,t){if(!t&&!SAFE_CLOSING)return!1;var r=!1;try{var n=[7],o=n[ITERATOR$3]();o.next=function(){return{done:r=!0}},n[ITERATOR$3]=function(){return o},e(n)}catch(e){}return r};_export(_export.S+_export.F*!_iterDetect(function(e){Array.from(e)}),"Array",{from:function(e){var t,r,n,o,i=_toObject(e),c="function"==typeof this?this:Array,s=arguments.length,u=s>1?arguments[1]:void 0,a=void 0!==u,l=0,f=core_getIteratorMethod(i);if(a&&(u=_ctx(u,s>2?arguments[2]:void 0,2)),void 0==f||c==Array&&_isArrayIter(f))for(r=new c(t=_toLength(i.length));t>l;l++)_createProperty(r,l,a?u(i[l],l):i[l]);else for(o=f.call(i),r=new c;!(n=o.next()).done;l++)_createProperty(r,l,a?_iterCall(o,u,[n.value,l],!0):n.value);return r.length=l,r}});var from$2=_core.Array.from,from=createCommonjsModule(function(e){e.exports={default:from$2,__esModule:!0}}),toConsumableArray=createCommonjsModule(function(e,t){t.__esModule=!0;var r=function(e){return e&&e.__esModule?e:{default:e}}(from);t.default=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return(0,r.default)(e)}}),_addToUnscopables=function(){},_iterStep=function(e,t){return{value:t,done:!!e}},es6_array_iterator=_iterDefine(Array,"Array",function(e,t){this._t=_toIobject(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,r=this._i++;return!e||r>=e.length?(this._t=void 0,_iterStep(1)):"keys"==t?_iterStep(0,r):"values"==t?_iterStep(0,e[r]):_iterStep(0,[r,e[r]])},"values");_iterators.Arguments=_iterators.Array,_addToUnscopables("keys"),_addToUnscopables("values"),_addToUnscopables("entries");for(var TO_STRING_TAG=_wks("toStringTag"),collections=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],i=0;i<5;i++){var NAME=collections[i],Collection=_global[NAME],proto=Collection&&Collection.prototype;proto&&!proto[TO_STRING_TAG]&&_hide(proto,TO_STRING_TAG,NAME),_iterators[NAME]=_iterators.Array}var f$3=_wks,_wksExt={f:f$3},iterator$2=_wksExt.f("iterator"),iterator=createCommonjsModule(function(e){e.exports={default:iterator$2,__esModule:!0}}),_meta=createCommonjsModule(function(e){var t=_uid("meta"),r=_objectDp.f,n=0,o=Object.isExtensible||function(){return!0},i=!_fails(function(){return o(Object.preventExtensions({}))}),c=function(e){r(e,t,{value:{i:"O"+ ++n,w:{}}})},s=e.exports={KEY:t,NEED:!1,fastKey:function(e,r){if(!_isObject(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!_has(e,t)){if(!o(e))return"F";if(!r)return"E";c(e)}return e[t].i},getWeak:function(e,r){if(!_has(e,t)){if(!o(e))return!0;if(!r)return!1;c(e)}return e[t].w},onFreeze:function(e){return i&&s.NEED&&o(e)&&!_has(e,t)&&c(e),e}}}),defineProperty=_objectDp.f,_wksDefine=function(e){var t=_core.Symbol||(_core.Symbol=_library?{}:_global.Symbol||{});"_"==e.charAt(0)||e in t||defineProperty(t,e,{value:_wksExt.f(e)})},_keyof=function(e,t){for(var r,n=_toIobject(e),o=_objectKeys(n),i=o.length,c=0;i>c;)if(n[r=o[c++]]===t)return r},_enumKeys=function(e){var t=_objectKeys(e),r=_objectGops.f;if(r)for(var n,o=r(e),i=_objectPie.f,c=0;o.length>c;)i.call(e,n=o[c++])&&t.push(n);return t},_isArray=Array.isArray||function(e){return"Array"==_cof(e)},hiddenKeys=_enumBugKeys.concat("length","prototype"),f$5=Object.getOwnPropertyNames||function(e){return _objectKeysInternal(e,hiddenKeys)},_objectGopn={f:f$5},gOPN$1=_objectGopn.f,toString$1={}.toString,windowNames="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],getWindowNames=function(e){try{return gOPN$1(e)}catch(e){return windowNames.slice()}},f$4=function(e){return windowNames&&"[object Window]"==toString$1.call(e)?getWindowNames(e):gOPN$1(_toIobject(e))},_objectGopnExt={f:f$4},gOPD$1=Object.getOwnPropertyDescriptor,f$6=_descriptors?gOPD$1:function(e,t){if(e=_toIobject(e),t=_toPrimitive(t,!0),_ie8DomDefine)try{return gOPD$1(e,t)}catch(e){}if(_has(e,t))return _propertyDesc(!_objectPie.f.call(e,t),e[t])},_objectGopd={f:f$6},META=_meta.KEY,gOPD=_objectGopd.f,dP$1=_objectDp.f,gOPN=_objectGopnExt.f,$Symbol=_global.Symbol,$JSON=_global.JSON,_stringify=$JSON&&$JSON.stringify,PROTOTYPE$2="prototype",HIDDEN=_wks("_hidden"),TO_PRIMITIVE=_wks("toPrimitive"),isEnum={}.propertyIsEnumerable,SymbolRegistry=_shared("symbol-registry"),AllSymbols=_shared("symbols"),OPSymbols=_shared("op-symbols"),ObjectProto$1=Object[PROTOTYPE$2],USE_NATIVE="function"==typeof $Symbol,QObject=_global.QObject,setter=!QObject||!QObject[PROTOTYPE$2]||!QObject[PROTOTYPE$2].findChild,setSymbolDesc=_descriptors&&_fails(function(){return 7!=_objectCreate(dP$1({},"a",{get:function(){return dP$1(this,"a",{value:7}).a}})).a})?function(e,t,r){var n=gOPD(ObjectProto$1,t);n&&delete ObjectProto$1[t],dP$1(e,t,r),n&&e!==ObjectProto$1&&dP$1(ObjectProto$1,t,n)}:dP$1,wrap=function(e){var t=AllSymbols[e]=_objectCreate($Symbol[PROTOTYPE$2]);return t._k=e,t},isSymbol=USE_NATIVE&&"symbol"==typeof $Symbol.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof $Symbol},$defineProperty=function(e,t,r){return e===ObjectProto$1&&$defineProperty(OPSymbols,t,r),_anObject(e),t=_toPrimitive(t,!0),_anObject(r),_has(AllSymbols,t)?(r.enumerable?(_has(e,HIDDEN)&&e[HIDDEN][t]&&(e[HIDDEN][t]=!1),r=_objectCreate(r,{enumerable:_propertyDesc(0,!1)})):(_has(e,HIDDEN)||dP$1(e,HIDDEN,_propertyDesc(1,{})),e[HIDDEN][t]=!0),setSymbolDesc(e,t,r)):dP$1(e,t,r)},$defineProperties=function(e,t){_anObject(e);for(var r,n=_enumKeys(t=_toIobject(t)),o=0,i=n.length;i>o;)$defineProperty(e,r=n[o++],t[r]);return e},$create=function(e,t){return void 0===t?_objectCreate(e):$defineProperties(_objectCreate(e),t)},$propertyIsEnumerable=function(e){var t=isEnum.call(this,e=_toPrimitive(e,!0));return!(this===ObjectProto$1&&_has(AllSymbols,e)&&!_has(OPSymbols,e))&&(!(t||!_has(this,e)||!_has(AllSymbols,e)||_has(this,HIDDEN)&&this[HIDDEN][e])||t)},$getOwnPropertyDescriptor=function(e,t){if(e=_toIobject(e),t=_toPrimitive(t,!0),e!==ObjectProto$1||!_has(AllSymbols,t)||_has(OPSymbols,t)){var r=gOPD(e,t);return!r||!_has(AllSymbols,t)||_has(e,HIDDEN)&&e[HIDDEN][t]||(r.enumerable=!0),r}},$getOwnPropertyNames=function(e){for(var t,r=gOPN(_toIobject(e)),n=[],o=0;r.length>o;)_has(AllSymbols,t=r[o++])||t==HIDDEN||t==META||n.push(t);return n},$getOwnPropertySymbols=function(e){for(var t,r=e===ObjectProto$1,n=gOPN(r?OPSymbols:_toIobject(e)),o=[],i=0;n.length>i;)!_has(AllSymbols,t=n[i++])||r&&!_has(ObjectProto$1,t)||o.push(AllSymbols[t]);return o};USE_NATIVE||(_redefine(($Symbol=function(){if(this instanceof $Symbol)throw TypeError("Symbol is not a constructor!");var e=_uid(arguments.length>0?arguments[0]:void 0),t=function(r){this===ObjectProto$1&&t.call(OPSymbols,r),_has(this,HIDDEN)&&_has(this[HIDDEN],e)&&(this[HIDDEN][e]=!1),setSymbolDesc(this,e,_propertyDesc(1,r))};return _descriptors&&setter&&setSymbolDesc(ObjectProto$1,e,{configurable:!0,set:t}),wrap(e)})[PROTOTYPE$2],"toString",function(){return this._k}),_objectGopd.f=$getOwnPropertyDescriptor,_objectDp.f=$defineProperty,_objectGopn.f=_objectGopnExt.f=$getOwnPropertyNames,_objectPie.f=$propertyIsEnumerable,_objectGops.f=$getOwnPropertySymbols,_descriptors&&!_library&&_redefine(ObjectProto$1,"propertyIsEnumerable",$propertyIsEnumerable,!0),_wksExt.f=function(e){return wrap(_wks(e))}),_export(_export.G+_export.W+_export.F*!USE_NATIVE,{Symbol:$Symbol});for(var symbols="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),i$1=0;symbols.length>i$1;)_wks(symbols[i$1++]);for(var symbols=_objectKeys(_wks.store),i$1=0;symbols.length>i$1;)_wksDefine(symbols[i$1++]);_export(_export.S+_export.F*!USE_NATIVE,"Symbol",{for:function(e){return _has(SymbolRegistry,e+="")?SymbolRegistry[e]:SymbolRegistry[e]=$Symbol(e)},keyFor:function(e){if(isSymbol(e))return _keyof(SymbolRegistry,e);throw TypeError(e+" is not a symbol!")},useSetter:function(){setter=!0},useSimple:function(){setter=!1}}),_export(_export.S+_export.F*!USE_NATIVE,"Object",{create:$create,defineProperty:$defineProperty,defineProperties:$defineProperties,getOwnPropertyDescriptor:$getOwnPropertyDescriptor,getOwnPropertyNames:$getOwnPropertyNames,getOwnPropertySymbols:$getOwnPropertySymbols}),$JSON&&_export(_export.S+_export.F*(!USE_NATIVE||_fails(function(){var e=$Symbol();return"[null]"!=_stringify([e])||"{}"!=_stringify({a:e})||"{}"!=_stringify(Object(e))})),"JSON",{stringify:function(e){if(void 0!==e&&!isSymbol(e)){for(var t,r,n=[e],o=1;arguments.length>o;)n.push(arguments[o++]);return"function"==typeof(t=n[1])&&(r=t),!r&&_isArray(t)||(t=function(e,t){if(r&&(t=r.call(this,e,t)),!isSymbol(t))return t}),n[1]=t,_stringify.apply($JSON,n)}}}),$Symbol[PROTOTYPE$2][TO_PRIMITIVE]||_hide($Symbol[PROTOTYPE$2],TO_PRIMITIVE,$Symbol[PROTOTYPE$2].valueOf),_setToStringTag($Symbol,"Symbol"),_setToStringTag(Math,"Math",!0),_setToStringTag(_global.JSON,"JSON",!0),_wksDefine("asyncIterator"),_wksDefine("observable");var index=_core.Symbol,symbol=createCommonjsModule(function(e){e.exports={default:index,__esModule:!0}}),_typeof_1=createCommonjsModule(function(e,t){function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var n=r(iterator),o=r(symbol),i="function"==typeof o.default&&"symbol"==typeof n.default?function(e){return typeof e}:function(e){return e&&"function"==typeof o.default&&e.constructor===o.default&&e!==o.default.prototype?"symbol":typeof e};t.default="function"==typeof o.default&&"symbol"===i(n.default)?function(e){return void 0===e?"undefined":i(e)}:function(e){return e&&"function"==typeof o.default&&e.constructor===o.default&&e!==o.default.prototype?"symbol":void 0===e?"undefined":i(e)}}),_typeof=unwrapExports(_typeof_1),classCallCheck=createCommonjsModule(function(e,t){t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}}),_classCallCheck=unwrapExports(classCallCheck);_export(_export.S+_export.F*!_descriptors,"Object",{defineProperty:_objectDp.f});var $Object=_core.Object,defineProperty$3=function(e,t,r){return $Object.defineProperty(e,t,r)},defineProperty$1=createCommonjsModule(function(e){e.exports={default:defineProperty$3,__esModule:!0}}),createClass=createCommonjsModule(function(e,t){t.__esModule=!0;var r=function(e){return e&&e.__esModule?e:{default:e}}(defineProperty$1);t.default=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),(0,r.default)(e,o.key,o)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}()}),_createClass=unwrapExports(createClass),Builder=function(){function e(t,r){_classCallCheck(this,e),this.checks=[],this.currentConfig={},this.currentOptions={},this.deprecatedMessage="",this.errorMessage="",this.isNullable=!1,this.isRequired=!1,this.defaultValue=r,this.type=t,this.addCheck(this.checkType)}return _createClass(e,[{key:"addCheck",value:function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this.checks.push({args:r,func:e}),this}},{key:"and",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.addCheck(this.checkAnd,t)}},{key:"checkAnd",value:function(e,t,r){}},{key:"checkType",value:function(e,t){}},{key:"deprecate",value:function(e){return this.deprecatedMessage=e,this}},{key:"invariant",value:function(e,t){arguments.length>2&&void 0!==arguments[2]&&arguments[2]}},{key:"key",value:function(e){var t=e.lastIndexOf(".");return t>0?e.slice(t+1):e}},{key:"message",value:function(e){return this.errorMessage=e,this}},{key:"nullable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.isNullable=e,this}},{key:"only",value:function(){return this.addCheck(this.checkOnly)}},{key:"checkOnly",value:function(e,t){}},{key:"or",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.addCheck(this.checkOr,t)}},{key:"checkOr",value:function(e,t,r){}},{key:"required",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.isRequired=e,this}},{key:"runChecks",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};this.currentConfig=n,this.currentOptions=r;var o=t;return void 0===o?this.isRequired||(o=this.defaultValue):this.deprecatedMessage,null===o&&this.isNullable,o}},{key:"xor",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.addCheck(this.checkXor,t)}},{key:"checkXor",value:function(e,t,r){}}]),e}();_objectSap("getPrototypeOf",function(){return function(e){return _objectGpo(_toObject(e))}});var getPrototypeOf$1=_core.Object.getPrototypeOf,getPrototypeOf=createCommonjsModule(function(e){e.exports={default:getPrototypeOf$1,__esModule:!0}}),_Object$getPrototypeOf=unwrapExports(getPrototypeOf),possibleConstructorReturn=createCommonjsModule(function(e,t){t.__esModule=!0;var r=function(e){return e&&e.__esModule?e:{default:e}}(_typeof_1);t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":(0,r.default)(t))&&"function"!=typeof t?e:t}}),_possibleConstructorReturn=unwrapExports(possibleConstructorReturn),check=function(e,t){if(_anObject(e),!_isObject(t)&&null!==t)throw TypeError(t+": can't set as prototype!")},_setProto={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=_ctx(Function.call,_objectGopd.f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return check(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:check};_export(_export.S,"Object",{setPrototypeOf:_setProto.set});var setPrototypeOf$2=_core.Object.setPrototypeOf,setPrototypeOf=createCommonjsModule(function(e){e.exports={default:setPrototypeOf$2,__esModule:!0}});_export(_export.S,"Object",{create:_objectCreate});var $Object$1=_core.Object,create$2=function(e,t){return $Object$1.create(e,t)},create=createCommonjsModule(function(e){e.exports={default:create$2,__esModule:!0}}),inherits=createCommonjsModule(function(e,t){function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var n=r(setPrototypeOf),o=r(create),i=r(_typeof_1);t.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":(0,i.default)(t)));e.prototype=(0,o.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(n.default?(0,n.default)(e,t):e.__proto__=t)}}),_inherits=unwrapExports(inherits),ArrayBuilder=function(e){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];_classCallCheck(this,t);var n=_possibleConstructorReturn(this,(t.__proto__||_Object$getPrototypeOf(t)).call(this,"array",r));return n.addCheck(n.checkContents,e),n}return _inherits(t,e),_createClass(t,[{key:"checkContents",value:function(e,t,r){}},{key:"notEmpty",value:function(){return this.addCheck(this.checkNotEmpty)}},{key:"checkNotEmpty",value:function(e,t){}}]),t}(Builder),BoolBuilder=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _classCallCheck(this,t),_possibleConstructorReturn(this,(t.__proto__||_Object$getPrototypeOf(t)).call(this,"boolean",e))}return _inherits(t,e),t}(Builder),CustomBuilder=function(e){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;_classCallCheck(this,t);var n=_possibleConstructorReturn(this,(t.__proto__||_Object$getPrototypeOf(t)).call(this,"custom",r));return n.addCheck(n.checkCallback,e),n}return _inherits(t,e),_createClass(t,[{key:"checkCallback",value:function(e,t,r){r(e,t,this.currentOptions,this.invariant.bind(this))}}]),t}(Builder),FuncBuilder=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;_classCallCheck(this,t);var r=_possibleConstructorReturn(this,(t.__proto__||_Object$getPrototypeOf(t)).call(this,"function",e));return r.nullable(),r}return _inherits(t,e),t}(Builder),InstanceBuilder=function(e){function t(e){_classCallCheck(this,t);var r=_possibleConstructorReturn(this,(t.__proto__||_Object$getPrototypeOf(t)).call(this,"instance",null));return r.nullable(),r.refClass=e,r.addCheck(r.checkInstance,e),r}return _inherits(t,e),_createClass(t,[{key:"checkInstance",value:function(e,t,r){}}]),t}(Builder),NumberBuilder=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return _classCallCheck(this,t),_possibleConstructorReturn(this,(t.__proto__||_Object$getPrototypeOf(t)).call(this,"number",e))}return _inherits(t,e),_createClass(t,[{key:"between",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.addCheck(this.checkBetween,e,t,r)}},{key:"checkBetween",value:function(e,t,r,n){arguments.length>4&&void 0!==arguments[4]&&arguments[4]}},{key:"gt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.addCheck(this.checkGreaterThan,e,t)}},{key:"gte",value:function(e){return this.gt(e,!0)}},{key:"checkGreaterThan",value:function(e,t,r){arguments.length>3&&void 0!==arguments[3]&&arguments[3]}},{key:"lt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.addCheck(this.checkLessThan,e,t)}},{key:"lte",value:function(e){return this.lt(e,!0)}},{key:"checkLessThan",value:function(e,t,r){arguments.length>3&&void 0!==arguments[3]&&arguments[3]}},{key:"oneOf",value:function(e){return this.addCheck(this.checkOneOf,e)}},{key:"checkOneOf",value:function(e,t,r){}}]),t}(Builder),ObjectBuilder=function(e){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,t);var n=_possibleConstructorReturn(this,(t.__proto__||_Object$getPrototypeOf(t)).call(this,"object",r));return e&&e instanceof Builder&&n.addCheck(n.checkContents,e),n}return _inherits(t,e),_createClass(t,[{key:"checkContents",value:function(e,t,r){}},{key:"notEmpty",value:function(){return this.addCheck(this.checkNotEmpty)}},{key:"checkNotEmpty",value:function(e,t){}}]),t}(Builder),ShapeBuilder=function(e){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,t);var n=_possibleConstructorReturn(this,(t.__proto__||_Object$getPrototypeOf(t)).call(this,"shape",r));return n.addCheck(n.checkContents,e),n}return _inherits(t,e),_createClass(t,[{key:"checkContents",value:function(e,t,r){}}]),t}(Builder),StringBuilder=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";_classCallCheck(this,t);var r=_possibleConstructorReturn(this,(t.__proto__||_Object$getPrototypeOf(t)).call(this,"string",e));return r.allowEmpty=!1,r.addCheck(r.checkNotEmpty),r}return _inherits(t,e),_createClass(t,[{key:"contains",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.addCheck(this.checkContains,e,t)}},{key:"checkContains",value:function(e,t,r){arguments.length>3&&void 0!==arguments[3]&&arguments[3]}},{key:"match",value:function(e){return this.addCheck(this.checkMatch,e)}},{key:"checkMatch",value:function(e,t,r){}},{key:"empty",value:function(){return this.allowEmpty=!0,this}},{key:"checkNotEmpty",value:function(e,t){}},{key:"oneOf",value:function(e){return this.addCheck(this.checkOneOf,e)}},{key:"checkOneOf",value:function(e,t,r){}}]),t}(Builder),UnionBuilder=function(e){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;_classCallCheck(this,t);var n=_possibleConstructorReturn(this,(t.__proto__||_Object$getPrototypeOf(t)).call(this,"union",r));return n.addCheck(n.checkUnions,e),n}return _inherits(t,e),_createClass(t,[{key:"checkUnions",value:function(e,t,r){}}]),t}(Builder);module.exports=Options;
"use strict";function unwrapExports(e){return e&&e.__esModule?e.default:e}function createCommonjsModule(e,t){return t={exports:{}},e(t,t.exports),t.exports}function isObject$1(e){return"object"===(void 0===e?"undefined":_typeof(e))&&null!==e&&!Array.isArray(e)}function custom(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new Builder("custom",t).custom(e)}function array(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return new ArrayBuilder(e,t)}function bool(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new BoolBuilder(e)}function func(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return new FuncBuilder(e)}function instance(e){return new InstanceBuilder(e)}function regex(){return instance(RegExp)}function date(){return instance(Date)}function number(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new NumberBuilder(e)}function object(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new ObjectBuilder(e,t)}function shape(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new ShapeBuilder(e,t)}function string(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return new StringBuilder(e)}function union(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new UnionBuilder(e,t)}function buildAndCheckOptions(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=_extends$1({},e),i={};return _Object$keys(t).forEach(function(c){var u=t[c],s=n?n+"."+c:c;u instanceof Builder?i[c]=u.runChecks(s,e[c],e,r):isObject$1(u)&&(i[c]=buildAndCheckOptions(e[c]||{},u,r,s)),delete o[c]}),r.unknown&&_Object$assign(i,o),i}function Options(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return buildAndCheckOptions(e,t({array:array,bool:bool,custom:custom,date:date,func:func,instance:instance,number:number,object:object,regex:regex,shape:shape,string:string,union:union}),r)}var _global=createCommonjsModule(function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)}),_core=createCommonjsModule(function(e){var t=e.exports={version:"2.4.0"};"number"==typeof __e&&(__e=t)}),_aFunction=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e},_ctx=function(e,t,r){if(_aFunction(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,o){return e.call(t,r,n,o)}}return function(){return e.apply(t,arguments)}},_isObject=function(e){return"object"==typeof e?null!==e:"function"==typeof e},_anObject=function(e){if(!_isObject(e))throw TypeError(e+" is not an object!");return e},_fails=function(e){try{return!!e()}catch(e){return!0}},_descriptors=!_fails(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),document$1=_global.document,is=_isObject(document$1)&&_isObject(document$1.createElement),_domCreate=function(e){return is?document$1.createElement(e):{}},_ie8DomDefine=!_descriptors&&!_fails(function(){return 7!=Object.defineProperty(_domCreate("div"),"a",{get:function(){return 7}}).a}),_toPrimitive=function(e,t){if(!_isObject(e))return e;var r,n;if(t&&"function"==typeof(r=e.toString)&&!_isObject(n=r.call(e)))return n;if("function"==typeof(r=e.valueOf)&&!_isObject(n=r.call(e)))return n;if(!t&&"function"==typeof(r=e.toString)&&!_isObject(n=r.call(e)))return n;throw TypeError("Can't convert object to primitive value")},dP=Object.defineProperty,f=_descriptors?Object.defineProperty:function(e,t,r){if(_anObject(e),t=_toPrimitive(t,!0),_anObject(r),_ie8DomDefine)try{return dP(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e},_objectDp={f:f},_propertyDesc=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},_hide=_descriptors?function(e,t,r){return _objectDp.f(e,t,_propertyDesc(1,r))}:function(e,t,r){return e[t]=r,e},PROTOTYPE="prototype",$export=function(e,t,r){var n,o,i,c=e&$export.F,u=e&$export.G,s=e&$export.S,a=e&$export.P,l=e&$export.B,f=e&$export.W,_=u?_core:_core[t]||(_core[t]={}),p=_[PROTOTYPE],y=u?_global:s?_global[t]:(_global[t]||{})[PROTOTYPE];u&&(r=t);for(n in r)(o=!c&&y&&void 0!==y[n])&&n in _||(i=o?y[n]:r[n],_[n]=u&&"function"!=typeof y[n]?r[n]:l&&o?_ctx(i,_global):f&&y[n]==i?function(e){var t=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,r)}return new e(t,r,n)}return e.apply(this,arguments)};return t[PROTOTYPE]=e[PROTOTYPE],t}(i):a&&"function"==typeof i?_ctx(Function.call,i):i,a&&((_.virtual||(_.virtual={}))[n]=i,e&$export.R&&p&&!p[n]&&_hide(p,n,i)))};$export.F=1,$export.G=2,$export.S=4,$export.P=8,$export.B=16,$export.W=32,$export.U=64,$export.R=128;var _export=$export,hasOwnProperty={}.hasOwnProperty,_has=function(e,t){return hasOwnProperty.call(e,t)},toString={}.toString,_cof=function(e){return toString.call(e).slice(8,-1)},_iobject=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==_cof(e)?e.split(""):Object(e)},_defined=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e},_toIobject=function(e){return _iobject(_defined(e))},ceil=Math.ceil,floor=Math.floor,_toInteger=function(e){return isNaN(e=+e)?0:(e>0?floor:ceil)(e)},min=Math.min,_toLength=function(e){return e>0?min(_toInteger(e),9007199254740991):0},max=Math.max,min$1=Math.min,_toIndex=function(e,t){return e=_toInteger(e),e<0?max(e+t,0):min$1(e,t)},_arrayIncludes=function(e){return function(t,r,n){var o,i=_toIobject(t),c=_toLength(i.length),u=_toIndex(n,c);if(e&&r!=r){for(;c>u;)if((o=i[u++])!=o)return!0}else for(;c>u;u++)if((e||u in i)&&i[u]===r)return e||u||0;return!e&&-1}},SHARED="__core-js_shared__",store=_global[SHARED]||(_global[SHARED]={}),_shared=function(e){return store[e]||(store[e]={})},id=0,px=Math.random(),_uid=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++id+px).toString(36))},shared=_shared("keys"),_sharedKey=function(e){return shared[e]||(shared[e]=_uid(e))},arrayIndexOf=_arrayIncludes(!1),IE_PROTO=_sharedKey("IE_PROTO"),_objectKeysInternal=function(e,t){var r,n=_toIobject(e),o=0,i=[];for(r in n)r!=IE_PROTO&&_has(n,r)&&i.push(r);for(;t.length>o;)_has(n,r=t[o++])&&(~arrayIndexOf(i,r)||i.push(r));return i},_enumBugKeys="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),_objectKeys=Object.keys||function(e){return _objectKeysInternal(e,_enumBugKeys)},f$1=Object.getOwnPropertySymbols,_objectGops={f:f$1},f$2={}.propertyIsEnumerable,_objectPie={f:f$2},_toObject=function(e){return Object(_defined(e))},$assign=Object.assign,_objectAssign=!$assign||_fails(function(){var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(e){t[e]=e}),7!=$assign({},e)[r]||Object.keys($assign({},t)).join("")!=n})?function(e,t){for(var r=_toObject(e),n=arguments.length,o=1,i=_objectGops.f,c=_objectPie.f;n>o;)for(var u,s=_iobject(arguments[o++]),a=i?_objectKeys(s).concat(i(s)):_objectKeys(s),l=a.length,f=0;l>f;)c.call(s,u=a[f++])&&(r[u]=s[u]);return r}:$assign;_export(_export.S+_export.F,"Object",{assign:_objectAssign});var assign$1=_core.Object.assign,assign=createCommonjsModule(function(e){e.exports={default:assign$1,__esModule:!0}}),_Object$assign=unwrapExports(assign),_objectSap=function(e,t){var r=(_core.Object||{})[e]||Object[e],n={};n[e]=t(r),_export(_export.S+_export.F*_fails(function(){r(1)}),"Object",n)};_objectSap("keys",function(){return function(e){return _objectKeys(_toObject(e))}});var keys$1=_core.Object.keys,keys=createCommonjsModule(function(e){e.exports={default:keys$1,__esModule:!0}}),_Object$keys=unwrapExports(keys),_extends=createCommonjsModule(function(e,t){t.__esModule=!0;var r=function(e){return e&&e.__esModule?e:{default:e}}(assign);t.default=r.default||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}}),_extends$1=unwrapExports(_extends),_stringAt=function(e){return function(t,r){var n,o,i=String(_defined(t)),c=_toInteger(r),u=i.length;return c<0||c>=u?e?"":void 0:(n=i.charCodeAt(c),n<55296||n>56319||c+1===u||(o=i.charCodeAt(c+1))<56320||o>57343?e?i.charAt(c):n:e?i.slice(c,c+2):o-56320+(n-55296<<10)+65536)}},_library=!0,_redefine=_hide,_iterators={},_objectDps=_descriptors?Object.defineProperties:function(e,t){_anObject(e);for(var r,n=_objectKeys(t),o=n.length,i=0;o>i;)_objectDp.f(e,r=n[i++],t[r]);return e},_html=_global.document&&document.documentElement,IE_PROTO$1=_sharedKey("IE_PROTO"),Empty=function(){},PROTOTYPE$1="prototype",createDict=function(){var e,t=_domCreate("iframe"),r=_enumBugKeys.length;for(t.style.display="none",_html.appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),createDict=e.F;r--;)delete createDict[PROTOTYPE$1][_enumBugKeys[r]];return createDict()},_objectCreate=Object.create||function(e,t){var r;return null!==e?(Empty[PROTOTYPE$1]=_anObject(e),r=new Empty,Empty[PROTOTYPE$1]=null,r[IE_PROTO$1]=e):r=createDict(),void 0===t?r:_objectDps(r,t)},_wks=createCommonjsModule(function(e){var t=_shared("wks"),r=_global.Symbol,n="function"==typeof r;(e.exports=function(e){return t[e]||(t[e]=n&&r[e]||(n?r:_uid)("Symbol."+e))}).store=t}),def=_objectDp.f,TAG=_wks("toStringTag"),_setToStringTag=function(e,t,r){e&&!_has(e=r?e:e.prototype,TAG)&&def(e,TAG,{configurable:!0,value:t})},IteratorPrototype={};_hide(IteratorPrototype,_wks("iterator"),function(){return this});var _iterCreate=function(e,t,r){e.prototype=_objectCreate(IteratorPrototype,{next:_propertyDesc(1,r)}),_setToStringTag(e,t+" Iterator")},IE_PROTO$2=_sharedKey("IE_PROTO"),ObjectProto=Object.prototype,_objectGpo=Object.getPrototypeOf||function(e){return e=_toObject(e),_has(e,IE_PROTO$2)?e[IE_PROTO$2]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?ObjectProto:null},ITERATOR=_wks("iterator"),BUGGY=!([].keys&&"next"in[].keys()),FF_ITERATOR="@@iterator",KEYS="keys",VALUES="values",returnThis=function(){return this},_iterDefine=function(e,t,r,n,o,i,c){_iterCreate(r,t,n);var u,s,a,l=function(e){if(!BUGGY&&e in y)return y[e];switch(e){case KEYS:case VALUES:return function(){return new r(this,e)}}return function(){return new r(this,e)}},f=t+" Iterator",_=o==VALUES,p=!1,y=e.prototype,h=y[ITERATOR]||y[FF_ITERATOR]||o&&y[o],d=h||l(o),b=o?_?l("entries"):d:void 0,O="Array"==t?y.entries||h:h;if(O&&(a=_objectGpo(O.call(new e)))!==Object.prototype&&(_setToStringTag(a,f,!0),_library||_has(a,ITERATOR)||_hide(a,ITERATOR,returnThis)),_&&h&&h.name!==VALUES&&(p=!0,d=function(){return h.call(this)}),_library&&!c||!BUGGY&&!p&&y[ITERATOR]||_hide(y,ITERATOR,d),_iterators[t]=d,_iterators[f]=returnThis,o)if(u={values:_?d:l(VALUES),keys:i?d:l(KEYS),entries:b},c)for(s in u)s in y||_redefine(y,s,u[s]);else _export(_export.P+_export.F*(BUGGY||p),t,u);return u},$at=_stringAt(!0);_iterDefine(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,r=this._i;return r>=t.length?{value:void 0,done:!0}:(e=$at(t,r),this._i+=e.length,{value:e,done:!1})});var _iterCall=function(e,t,r,n){try{return n?t(_anObject(r)[0],r[1]):t(r)}catch(t){var o=e.return;throw void 0!==o&&_anObject(o.call(e)),t}},ITERATOR$1=_wks("iterator"),ArrayProto=Array.prototype,_isArrayIter=function(e){return void 0!==e&&(_iterators.Array===e||ArrayProto[ITERATOR$1]===e)},_createProperty=function(e,t,r){t in e?_objectDp.f(e,t,_propertyDesc(0,r)):e[t]=r},TAG$1=_wks("toStringTag"),ARG="Arguments"==_cof(function(){return arguments}()),tryGet=function(e,t){try{return e[t]}catch(e){}},_classof=function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=tryGet(t=Object(e),TAG$1))?r:ARG?_cof(t):"Object"==(n=_cof(t))&&"function"==typeof t.callee?"Arguments":n},ITERATOR$2=_wks("iterator"),core_getIteratorMethod=_core.getIteratorMethod=function(e){if(void 0!=e)return e[ITERATOR$2]||e["@@iterator"]||_iterators[_classof(e)]},ITERATOR$3=_wks("iterator"),SAFE_CLOSING=!1;try{var riter=[7][ITERATOR$3]();riter.return=function(){SAFE_CLOSING=!0},Array.from(riter,function(){throw 2})}catch(e){}var _iterDetect=function(e,t){if(!t&&!SAFE_CLOSING)return!1;var r=!1;try{var n=[7],o=n[ITERATOR$3]();o.next=function(){return{done:r=!0}},n[ITERATOR$3]=function(){return o},e(n)}catch(e){}return r};_export(_export.S+_export.F*!_iterDetect(function(e){Array.from(e)}),"Array",{from:function(e){var t,r,n,o,i=_toObject(e),c="function"==typeof this?this:Array,u=arguments.length,s=u>1?arguments[1]:void 0,a=void 0!==s,l=0,f=core_getIteratorMethod(i);if(a&&(s=_ctx(s,u>2?arguments[2]:void 0,2)),void 0==f||c==Array&&_isArrayIter(f))for(r=new c(t=_toLength(i.length));t>l;l++)_createProperty(r,l,a?s(i[l],l):i[l]);else for(o=f.call(i),r=new c;!(n=o.next()).done;l++)_createProperty(r,l,a?_iterCall(o,s,[n.value,l],!0):n.value);return r.length=l,r}});var from$2=_core.Array.from,from=createCommonjsModule(function(e){e.exports={default:from$2,__esModule:!0}}),toConsumableArray=createCommonjsModule(function(e,t){t.__esModule=!0;var r=function(e){return e&&e.__esModule?e:{default:e}}(from);t.default=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return(0,r.default)(e)}}),_addToUnscopables=function(){},_iterStep=function(e,t){return{value:t,done:!!e}},es6_array_iterator=_iterDefine(Array,"Array",function(e,t){this._t=_toIobject(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,r=this._i++;return!e||r>=e.length?(this._t=void 0,_iterStep(1)):"keys"==t?_iterStep(0,r):"values"==t?_iterStep(0,e[r]):_iterStep(0,[r,e[r]])},"values");_iterators.Arguments=_iterators.Array,_addToUnscopables("keys"),_addToUnscopables("values"),_addToUnscopables("entries");for(var TO_STRING_TAG=_wks("toStringTag"),collections=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],i=0;i<5;i++){var NAME=collections[i],Collection=_global[NAME],proto=Collection&&Collection.prototype;proto&&!proto[TO_STRING_TAG]&&_hide(proto,TO_STRING_TAG,NAME),_iterators[NAME]=_iterators.Array}var f$3=_wks,_wksExt={f:f$3},iterator$2=_wksExt.f("iterator"),iterator=createCommonjsModule(function(e){e.exports={default:iterator$2,__esModule:!0}}),_meta=createCommonjsModule(function(e){var t=_uid("meta"),r=_objectDp.f,n=0,o=Object.isExtensible||function(){return!0},i=!_fails(function(){return o(Object.preventExtensions({}))}),c=function(e){r(e,t,{value:{i:"O"+ ++n,w:{}}})},u=e.exports={KEY:t,NEED:!1,fastKey:function(e,r){if(!_isObject(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!_has(e,t)){if(!o(e))return"F";if(!r)return"E";c(e)}return e[t].i},getWeak:function(e,r){if(!_has(e,t)){if(!o(e))return!0;if(!r)return!1;c(e)}return e[t].w},onFreeze:function(e){return i&&u.NEED&&o(e)&&!_has(e,t)&&c(e),e}}}),defineProperty=_objectDp.f,_wksDefine=function(e){var t=_core.Symbol||(_core.Symbol=_library?{}:_global.Symbol||{});"_"==e.charAt(0)||e in t||defineProperty(t,e,{value:_wksExt.f(e)})},_keyof=function(e,t){for(var r,n=_toIobject(e),o=_objectKeys(n),i=o.length,c=0;i>c;)if(n[r=o[c++]]===t)return r},_enumKeys=function(e){var t=_objectKeys(e),r=_objectGops.f;if(r)for(var n,o=r(e),i=_objectPie.f,c=0;o.length>c;)i.call(e,n=o[c++])&&t.push(n);return t},_isArray=Array.isArray||function(e){return"Array"==_cof(e)},hiddenKeys=_enumBugKeys.concat("length","prototype"),f$5=Object.getOwnPropertyNames||function(e){return _objectKeysInternal(e,hiddenKeys)},_objectGopn={f:f$5},gOPN$1=_objectGopn.f,toString$1={}.toString,windowNames="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],getWindowNames=function(e){try{return gOPN$1(e)}catch(e){return windowNames.slice()}},f$4=function(e){return windowNames&&"[object Window]"==toString$1.call(e)?getWindowNames(e):gOPN$1(_toIobject(e))},_objectGopnExt={f:f$4},gOPD$1=Object.getOwnPropertyDescriptor,f$6=_descriptors?gOPD$1:function(e,t){if(e=_toIobject(e),t=_toPrimitive(t,!0),_ie8DomDefine)try{return gOPD$1(e,t)}catch(e){}if(_has(e,t))return _propertyDesc(!_objectPie.f.call(e,t),e[t])},_objectGopd={f:f$6},META=_meta.KEY,gOPD=_objectGopd.f,dP$1=_objectDp.f,gOPN=_objectGopnExt.f,$Symbol=_global.Symbol,$JSON=_global.JSON,_stringify=$JSON&&$JSON.stringify,PROTOTYPE$2="prototype",HIDDEN=_wks("_hidden"),TO_PRIMITIVE=_wks("toPrimitive"),isEnum={}.propertyIsEnumerable,SymbolRegistry=_shared("symbol-registry"),AllSymbols=_shared("symbols"),OPSymbols=_shared("op-symbols"),ObjectProto$1=Object[PROTOTYPE$2],USE_NATIVE="function"==typeof $Symbol,QObject=_global.QObject,setter=!QObject||!QObject[PROTOTYPE$2]||!QObject[PROTOTYPE$2].findChild,setSymbolDesc=_descriptors&&_fails(function(){return 7!=_objectCreate(dP$1({},"a",{get:function(){return dP$1(this,"a",{value:7}).a}})).a})?function(e,t,r){var n=gOPD(ObjectProto$1,t);n&&delete ObjectProto$1[t],dP$1(e,t,r),n&&e!==ObjectProto$1&&dP$1(ObjectProto$1,t,n)}:dP$1,wrap=function(e){var t=AllSymbols[e]=_objectCreate($Symbol[PROTOTYPE$2]);return t._k=e,t},isSymbol=USE_NATIVE&&"symbol"==typeof $Symbol.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof $Symbol},$defineProperty=function(e,t,r){return e===ObjectProto$1&&$defineProperty(OPSymbols,t,r),_anObject(e),t=_toPrimitive(t,!0),_anObject(r),_has(AllSymbols,t)?(r.enumerable?(_has(e,HIDDEN)&&e[HIDDEN][t]&&(e[HIDDEN][t]=!1),r=_objectCreate(r,{enumerable:_propertyDesc(0,!1)})):(_has(e,HIDDEN)||dP$1(e,HIDDEN,_propertyDesc(1,{})),e[HIDDEN][t]=!0),setSymbolDesc(e,t,r)):dP$1(e,t,r)},$defineProperties=function(e,t){_anObject(e);for(var r,n=_enumKeys(t=_toIobject(t)),o=0,i=n.length;i>o;)$defineProperty(e,r=n[o++],t[r]);return e},$create=function(e,t){return void 0===t?_objectCreate(e):$defineProperties(_objectCreate(e),t)},$propertyIsEnumerable=function(e){var t=isEnum.call(this,e=_toPrimitive(e,!0));return!(this===ObjectProto$1&&_has(AllSymbols,e)&&!_has(OPSymbols,e))&&(!(t||!_has(this,e)||!_has(AllSymbols,e)||_has(this,HIDDEN)&&this[HIDDEN][e])||t)},$getOwnPropertyDescriptor=function(e,t){if(e=_toIobject(e),t=_toPrimitive(t,!0),e!==ObjectProto$1||!_has(AllSymbols,t)||_has(OPSymbols,t)){var r=gOPD(e,t);return!r||!_has(AllSymbols,t)||_has(e,HIDDEN)&&e[HIDDEN][t]||(r.enumerable=!0),r}},$getOwnPropertyNames=function(e){for(var t,r=gOPN(_toIobject(e)),n=[],o=0;r.length>o;)_has(AllSymbols,t=r[o++])||t==HIDDEN||t==META||n.push(t);return n},$getOwnPropertySymbols=function(e){for(var t,r=e===ObjectProto$1,n=gOPN(r?OPSymbols:_toIobject(e)),o=[],i=0;n.length>i;)!_has(AllSymbols,t=n[i++])||r&&!_has(ObjectProto$1,t)||o.push(AllSymbols[t]);return o};USE_NATIVE||(_redefine(($Symbol=function(){if(this instanceof $Symbol)throw TypeError("Symbol is not a constructor!");var e=_uid(arguments.length>0?arguments[0]:void 0),t=function(r){this===ObjectProto$1&&t.call(OPSymbols,r),_has(this,HIDDEN)&&_has(this[HIDDEN],e)&&(this[HIDDEN][e]=!1),setSymbolDesc(this,e,_propertyDesc(1,r))};return _descriptors&&setter&&setSymbolDesc(ObjectProto$1,e,{configurable:!0,set:t}),wrap(e)})[PROTOTYPE$2],"toString",function(){return this._k}),_objectGopd.f=$getOwnPropertyDescriptor,_objectDp.f=$defineProperty,_objectGopn.f=_objectGopnExt.f=$getOwnPropertyNames,_objectPie.f=$propertyIsEnumerable,_objectGops.f=$getOwnPropertySymbols,_descriptors&&!_library&&_redefine(ObjectProto$1,"propertyIsEnumerable",$propertyIsEnumerable,!0),_wksExt.f=function(e){return wrap(_wks(e))}),_export(_export.G+_export.W+_export.F*!USE_NATIVE,{Symbol:$Symbol});for(var symbols="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),i$1=0;symbols.length>i$1;)_wks(symbols[i$1++]);for(var symbols=_objectKeys(_wks.store),i$1=0;symbols.length>i$1;)_wksDefine(symbols[i$1++]);_export(_export.S+_export.F*!USE_NATIVE,"Symbol",{for:function(e){return _has(SymbolRegistry,e+="")?SymbolRegistry[e]:SymbolRegistry[e]=$Symbol(e)},keyFor:function(e){if(isSymbol(e))return _keyof(SymbolRegistry,e);throw TypeError(e+" is not a symbol!")},useSetter:function(){setter=!0},useSimple:function(){setter=!1}}),_export(_export.S+_export.F*!USE_NATIVE,"Object",{create:$create,defineProperty:$defineProperty,defineProperties:$defineProperties,getOwnPropertyDescriptor:$getOwnPropertyDescriptor,getOwnPropertyNames:$getOwnPropertyNames,getOwnPropertySymbols:$getOwnPropertySymbols}),$JSON&&_export(_export.S+_export.F*(!USE_NATIVE||_fails(function(){var e=$Symbol();return"[null]"!=_stringify([e])||"{}"!=_stringify({a:e})||"{}"!=_stringify(Object(e))})),"JSON",{stringify:function(e){if(void 0!==e&&!isSymbol(e)){for(var t,r,n=[e],o=1;arguments.length>o;)n.push(arguments[o++]);return"function"==typeof(t=n[1])&&(r=t),!r&&_isArray(t)||(t=function(e,t){if(r&&(t=r.call(this,e,t)),!isSymbol(t))return t}),n[1]=t,_stringify.apply($JSON,n)}}}),$Symbol[PROTOTYPE$2][TO_PRIMITIVE]||_hide($Symbol[PROTOTYPE$2],TO_PRIMITIVE,$Symbol[PROTOTYPE$2].valueOf),_setToStringTag($Symbol,"Symbol"),_setToStringTag(Math,"Math",!0),_setToStringTag(_global.JSON,"JSON",!0),_wksDefine("asyncIterator"),_wksDefine("observable");var index=_core.Symbol,symbol=createCommonjsModule(function(e){e.exports={default:index,__esModule:!0}}),_typeof_1=createCommonjsModule(function(e,t){function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var n=r(iterator),o=r(symbol),i="function"==typeof o.default&&"symbol"==typeof n.default?function(e){return typeof e}:function(e){return e&&"function"==typeof o.default&&e.constructor===o.default&&e!==o.default.prototype?"symbol":typeof e};t.default="function"==typeof o.default&&"symbol"===i(n.default)?function(e){return void 0===e?"undefined":i(e)}:function(e){return e&&"function"==typeof o.default&&e.constructor===o.default&&e!==o.default.prototype?"symbol":void 0===e?"undefined":i(e)}}),_typeof=unwrapExports(_typeof_1),classCallCheck=createCommonjsModule(function(e,t){t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}}),_classCallCheck=unwrapExports(classCallCheck);_export(_export.S+_export.F*!_descriptors,"Object",{defineProperty:_objectDp.f});var $Object=_core.Object,defineProperty$3=function(e,t,r){return $Object.defineProperty(e,t,r)},defineProperty$1=createCommonjsModule(function(e){e.exports={default:defineProperty$3,__esModule:!0}}),createClass=createCommonjsModule(function(e,t){t.__esModule=!0;var r=function(e){return e&&e.__esModule?e:{default:e}}(defineProperty$1);t.default=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),(0,r.default)(e,o.key,o)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}()}),_createClass=unwrapExports(createClass),Builder=function(){function e(t,r){_classCallCheck(this,e),this.checks=[],this.currentConfig={},this.currentOptions={},this.deprecatedMessage="",this.errorMessage="",this.isNullable=!1,this.isRequired=!1,this.defaultValue=r,this.type=t,this.addCheck(this.checkType)}return _createClass(e,[{key:"addCheck",value:function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this.checks.push({args:r,func:e}),this}},{key:"and",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.addCheck(this.checkAnd,t)}},{key:"checkAnd",value:function(e,t,r){}},{key:"checkType",value:function(e,t){}},{key:"custom",value:function(e){return this.addCheck(this.checkCustom,e)}},{key:"checkCustom",value:function(e,t,r){}},{key:"deprecate",value:function(e){return this.deprecatedMessage=e,this}},{key:"invariant",value:function(e,t){arguments.length>2&&void 0!==arguments[2]&&arguments[2]}},{key:"key",value:function(e){var t=e.lastIndexOf(".");return t>0?e.slice(t+1):e}},{key:"message",value:function(e){return this.errorMessage=e,this}},{key:"nullable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.isNullable=e,this}},{key:"only",value:function(){return this.addCheck(this.checkOnly)}},{key:"checkOnly",value:function(e,t){}},{key:"or",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.addCheck(this.checkOr,t)}},{key:"checkOr",value:function(e,t,r){}},{key:"required",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.isRequired=e,this}},{key:"runChecks",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};this.currentConfig=n,this.currentOptions=r;var o=t;return void 0===o?this.isRequired||(o=this.defaultValue):this.deprecatedMessage,null===o&&this.isNullable,o}},{key:"typeName",value:function(){return this.type}},{key:"xor",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.addCheck(this.checkXor,t)}},{key:"checkXor",value:function(e,t,r){}}]),e}();_objectSap("getPrototypeOf",function(){return function(e){return _objectGpo(_toObject(e))}});var getPrototypeOf$1=_core.Object.getPrototypeOf,getPrototypeOf=createCommonjsModule(function(e){e.exports={default:getPrototypeOf$1,__esModule:!0}}),_Object$getPrototypeOf=unwrapExports(getPrototypeOf),possibleConstructorReturn=createCommonjsModule(function(e,t){t.__esModule=!0;var r=function(e){return e&&e.__esModule?e:{default:e}}(_typeof_1);t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":(0,r.default)(t))&&"function"!=typeof t?e:t}}),_possibleConstructorReturn=unwrapExports(possibleConstructorReturn),check=function(e,t){if(_anObject(e),!_isObject(t)&&null!==t)throw TypeError(t+": can't set as prototype!")},_setProto={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=_ctx(Function.call,_objectGopd.f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return check(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:check};_export(_export.S,"Object",{setPrototypeOf:_setProto.set});var setPrototypeOf$2=_core.Object.setPrototypeOf,setPrototypeOf=createCommonjsModule(function(e){e.exports={default:setPrototypeOf$2,__esModule:!0}});_export(_export.S,"Object",{create:_objectCreate});var $Object$1=_core.Object,create$2=function(e,t){return $Object$1.create(e,t)},create=createCommonjsModule(function(e){e.exports={default:create$2,__esModule:!0}}),inherits=createCommonjsModule(function(e,t){function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var n=r(setPrototypeOf),o=r(create),i=r(_typeof_1);t.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":(0,i.default)(t)));e.prototype=(0,o.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(n.default?(0,n.default)(e,t):e.__proto__=t)}}),_inherits=unwrapExports(inherits),ArrayBuilder=function(e){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];_classCallCheck(this,t);var n=_possibleConstructorReturn(this,(t.__proto__||_Object$getPrototypeOf(t)).call(this,"array",r));return n.addCheck(n.checkContents,e),n}return _inherits(t,e),_createClass(t,[{key:"checkContents",value:function(e,t,r){}},{key:"notEmpty",value:function(){return this.addCheck(this.checkNotEmpty)}},{key:"checkNotEmpty",value:function(e,t){}}]),t}(Builder),BoolBuilder=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _classCallCheck(this,t),_possibleConstructorReturn(this,(t.__proto__||_Object$getPrototypeOf(t)).call(this,"boolean",e))}return _inherits(t,e),t}(Builder),FuncBuilder=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;_classCallCheck(this,t);var r=_possibleConstructorReturn(this,(t.__proto__||_Object$getPrototypeOf(t)).call(this,"function",e));return r.nullable(),r}return _inherits(t,e),t}(Builder),InstanceBuilder=function(e){function t(e){_classCallCheck(this,t);var r=_possibleConstructorReturn(this,(t.__proto__||_Object$getPrototypeOf(t)).call(this,"instance",null));return r.nullable(),r.refClass=e,r.addCheck(r.checkInstance,e),r}return _inherits(t,e),_createClass(t,[{key:"checkInstance",value:function(e,t,r){}},{key:"typeName",value:function(){var e=this.refClass;return e?e.name||e.constructor.name:this.type}}]),t}(Builder),NumberBuilder=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return _classCallCheck(this,t),_possibleConstructorReturn(this,(t.__proto__||_Object$getPrototypeOf(t)).call(this,"number",e))}return _inherits(t,e),_createClass(t,[{key:"between",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.addCheck(this.checkBetween,e,t,r)}},{key:"checkBetween",value:function(e,t,r,n){arguments.length>4&&void 0!==arguments[4]&&arguments[4]}},{key:"gt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.addCheck(this.checkGreaterThan,e,t)}},{key:"gte",value:function(e){return this.gt(e,!0)}},{key:"checkGreaterThan",value:function(e,t,r){arguments.length>3&&void 0!==arguments[3]&&arguments[3]}},{key:"lt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.addCheck(this.checkLessThan,e,t)}},{key:"lte",value:function(e){return this.lt(e,!0)}},{key:"checkLessThan",value:function(e,t,r){arguments.length>3&&void 0!==arguments[3]&&arguments[3]}},{key:"oneOf",value:function(e){return this.addCheck(this.checkOneOf,e)}},{key:"checkOneOf",value:function(e,t,r){}}]),t}(Builder),ObjectBuilder=function(e){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,t);var n=_possibleConstructorReturn(this,(t.__proto__||_Object$getPrototypeOf(t)).call(this,"object",r));return e&&e instanceof Builder&&n.addCheck(n.checkContents,e),n}return _inherits(t,e),_createClass(t,[{key:"checkContents",value:function(e,t,r){}},{key:"notEmpty",value:function(){return this.addCheck(this.checkNotEmpty)}},{key:"checkNotEmpty",value:function(e,t){}}]),t}(Builder),ShapeBuilder=function(e){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,t);var n=_possibleConstructorReturn(this,(t.__proto__||_Object$getPrototypeOf(t)).call(this,"shape",r));return n.addCheck(n.checkContents,e),n}return _inherits(t,e),_createClass(t,[{key:"checkContents",value:function(e,t,r){}}]),t}(Builder),StringBuilder=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";_classCallCheck(this,t);var r=_possibleConstructorReturn(this,(t.__proto__||_Object$getPrototypeOf(t)).call(this,"string",e));return r.allowEmpty=!1,r.addCheck(r.checkNotEmpty),r}return _inherits(t,e),_createClass(t,[{key:"contains",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.addCheck(this.checkContains,e,t)}},{key:"checkContains",value:function(e,t,r){arguments.length>3&&void 0!==arguments[3]&&arguments[3]}},{key:"match",value:function(e){return this.addCheck(this.checkMatch,e)}},{key:"checkMatch",value:function(e,t,r){}},{key:"empty",value:function(){return this.allowEmpty=!0,this}},{key:"checkNotEmpty",value:function(e,t){}},{key:"oneOf",value:function(e){return this.addCheck(this.checkOneOf,e)}},{key:"checkOneOf",value:function(e,t,r){}}]),t}(Builder),UnionBuilder=function(e){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;_classCallCheck(this,t);var n=_possibleConstructorReturn(this,(t.__proto__||_Object$getPrototypeOf(t)).call(this,"union",r));return n.addCheck(n.checkUnions,e),n}return _inherits(t,e),_createClass(t,[{key:"checkUnions",value:function(e,t,r){}}]),t}(Builder);module.exports=Options;

@@ -60,5 +60,12 @@ 'use strict';

if ("production" !== process.env.NODE_ENV) {
this.invariant(value instanceof refClass, 'Must be an instance of "' + (refClass.name || refClass.constructor.name) + '".', path);
this.invariant(value instanceof refClass, 'Must be an instance of "' + this.typeName() + '".', path);
}
}
}, {
key: 'typeName',
value: function typeName() {
var refClass = this.refClass;
return refClass ? refClass.name || refClass.constructor.name : this.type;
}
}]);

@@ -65,0 +72,0 @@ return InstanceBuilder;

@@ -29,4 +29,2 @@ 'use strict';

var _CustomBuilder = require('./CustomBuilder');
var _FuncBuilder = require('./FuncBuilder');

@@ -56,2 +54,8 @@

/**
* @copyright 2017, Miles Johnson
* @license https://opensource.org/licenses/MIT
*
*/
function buildAndCheckOptions(baseOptions, blueprint) {

@@ -90,7 +94,3 @@ var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};

return options;
} /**
* @copyright 2017, Miles Johnson
* @license https://opensource.org/licenses/MIT
*
*/
}

@@ -113,3 +113,3 @@ function Options(baseOptions, factory) {

bool: _BoolBuilder.bool,
custom: _CustomBuilder.custom,
custom: _Builder.custom,
date: _InstanceBuilder.date,

@@ -116,0 +116,0 @@ func: _FuncBuilder.func,

@@ -7,6 +7,2 @@ 'use strict';

var _keys = require('babel-runtime/core-js/object/keys');
var _keys2 = _interopRequireDefault(_keys);
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');

@@ -76,2 +72,3 @@

var usage = {};
var keys = [];
var type = (0, _typeOf2.default)(value);

@@ -86,2 +83,3 @@

usage[builder.type] = true;
keys.push(builder.typeName());
}

@@ -103,3 +101,3 @@ });

this.invariant(checked, 'Type must be one of: ' + (0, _keys2.default)(usage).join(', ') + '.', path);
this.invariant(checked, 'Type must be one of: ' + keys.join(', '), path);
}

@@ -106,0 +104,0 @@ }

{
"name": "optimal",
"version": "0.11.0",
"version": "0.12.0",
"description": "Options object builder and validator.",

@@ -46,3 +46,3 @@ "main": "./lib/index.js",

"devDependencies": {
"@milesj/build-tool-config": "^0.14.0"
"@milesj/build-tool-config": "^0.15.0"
},

@@ -49,0 +49,0 @@ "babel": {

@@ -9,3 +9,3 @@ /**

import type { SupportedType, Checker, Config } from './types';
import type { SupportedType, Checker, Config, CustomCallback } from './types';

@@ -120,2 +120,29 @@ export default class Builder<T> {

/**
* Set a callback to run custom logic.
*/
custom(callback: CustomCallback): this {
if (__DEV__) {
this.invariant(
(typeof callback === 'function'),
'Custom blueprints require a validation function.',
);
}
return this.addCheck(this.checkCustom, callback);
}
/**
* Validate the value using a custom callback.
*/
checkCustom(path: string, value: *, callback: CustomCallback) {
if (__DEV__) {
try {
callback(value, this.currentOptions);
} catch (error) {
this.invariant(false, error.message, path);
}
}
}
/**
* Set a message to log when this field is present.

@@ -311,2 +338,9 @@ */

/**
* Return a human readable type name.
*/
typeName(): string {
return this.type;
}
/**
* Map a list of option names that must not be defined alongside this field.

@@ -344,1 +378,5 @@ */

}
export function custom(callback: CustomCallback, defaultValue?: * = null): Builder<*> {
return new Builder('custom', defaultValue).custom(callback);
}

@@ -33,4 +33,3 @@ /**

(value instanceof refClass),
// $FlowIgnore constructor check
`Must be an instance of "${refClass.name || refClass.constructor.name}".`,
`Must be an instance of "${this.typeName()}".`,
path,

@@ -40,2 +39,12 @@ );

}
/**
* Return the class name if available.
*/
typeName(): string {
const { refClass } = this;
// $FlowIgnore constructor check
return refClass ? (refClass.name || refClass.constructor.name) : this.type;
}
}

@@ -42,0 +51,0 @@

@@ -7,6 +7,5 @@ /**

import Builder from './Builder';
import Builder, { custom } from './Builder';
import { array } from './ArrayBuilder';
import { bool } from './BoolBuilder';
import { custom } from './CustomBuilder';
import { func } from './FuncBuilder';

@@ -13,0 +12,0 @@ import { instance, date, regex } from './InstanceBuilder';

@@ -12,3 +12,2 @@ /**

import type BoolBuilder from './BoolBuilder';
import type CustomBuilder from './CustomBuilder';
import type FuncBuilder from './FuncBuilder';

@@ -30,2 +29,4 @@ import type InstanceBuilder from './InstanceBuilder';

export type CustomCallback = (value: *, options: Object) => void;
export type Blueprint = { [key: string]: Builder<*> | Blueprint };

@@ -36,3 +37,3 @@

bool: (defaultValue?: ?boolean) => BoolBuilder,
custom: (checker: Checker, defaultValue?: *) => CustomBuilder,
custom: (callback: CustomCallback, defaultValue?: *) => Builder<*>,
date: () => InstanceBuilder<Class<Date>>,

@@ -39,0 +40,0 @@ func: (defaultValue?: ?Function) => FuncBuilder,

@@ -31,2 +31,3 @@ /**

const usage = {};
const keys = [];
const type = typeOf(value);

@@ -44,2 +45,3 @@

usage[builder.type] = true;
keys.push(builder.typeName());
}

@@ -70,3 +72,3 @@ });

this.invariant(checked, `Type must be one of: ${Object.keys(usage).join(', ')}.`, path);
this.invariant(checked, `Type must be one of: ${keys.join(', ')}`, path);
}

@@ -73,0 +75,0 @@ }

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc