Comparing version 2.1.0 to 2.2.0
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.normalizr=e():t.normalizr=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e,n){t[e]=n}function i(t,e,n,r){var i=r.assignEntity,a=void 0===i?o:i,u={};for(var c in t)if(t.hasOwnProperty(c)){var f=e&&e.getAssignEntity&&e.getAssignEntity(),s=l(t[c],e[c],n,r);a.call(null,u,c,s,t,e),f&&f.call(null,u,c,s,t,e)}return u}function a(t,e,n,r){return function(t){return l(t,e,n,r)}}function u(t,e,n,r){return function(o){var i=t.getSchemaKey(o),a=l(o,e[i],n,r);return{id:a,schema:i}}}function c(t,e,n,r){var o=e.getItemSchema(),i=a(e,o,n,r);return Array.isArray(t)?t.map(i):Object.keys(t).reduce(function(e,n){return e[n]=i(t[n]),e},{})}function f(t,e,n,r){var o=e.getItemSchema();return u(e,o,n,r)(t)}function s(t,e,n){for(var r in e)e.hasOwnProperty(r)&&(t.hasOwnProperty(r)&&!(0,O["default"])(t[r],e[r])?console.warn("When merging two "+n+', found unequal data in their "'+r+'" values. Using the earlier value.',t[r],e[r]):t[r]=e[r])}function p(t,e,n,r){var o=r.mergeIntoEntity,a=void 0===o?s:o,u=e.getKey(),c=e.getId(t);n.hasOwnProperty(u)||(n[u]={}),n[u].hasOwnProperty(c)||(n[u][c]={});var f=n[u][c],p=i(t,e,n,r);return a(f,p,u),c}function l(t,e,n,r){return(0,S["default"])(t)&&(0,S["default"])(e)?e instanceof b["default"]?p(t,e,n,r):e instanceof j["default"]?c(t,e,n,r):e instanceof m["default"]?f(t,e,n,r):i(t,e,n,r):t}function v(t,e){return new j["default"](t,e)}function h(t,e){return new j["default"](t,e)}function y(t,e){return new m["default"](t,e)}function _(t,e){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];if(!(0,S["default"])(t))throw new Error("Normalize accepts an object or an array as its input.");if(!(0,S["default"])(e)||Array.isArray(e))throw new Error("Normalize accepts an object for schema.");var r={},o=l(t,e,r,n);return{entities:r,result:o}}Object.defineProperty(e,"__esModule",{value:!0}),e.Schema=void 0,e.arrayOf=v,e.valuesOf=h,e.unionOf=y,e.normalize=_;var d=n(20),b=r(d),g=n(21),j=r(g),x=n(11),m=r(x),w=n(74),O=r(w),A=n(3),S=r(A);e.Schema=b["default"]},function(t,e,n){(function(t,r){var o=n(37),i={"function":!0,object:!0},a=i[typeof e]&&e&&!e.nodeType?e:void 0,u=i[typeof t]&&t&&!t.nodeType?t:void 0,c=o(a&&u&&"object"==typeof r&&r),f=o(i[typeof self]&&self),s=o(i[typeof window]&&window),p=o(i[typeof this]&&this),l=c||s!==(p&&p.window)&&s||f||p||Function("return this")();t.exports=l}).call(e,n(79)(t),function(){return this}())},function(t,e,n){function r(t,e){var n=t[e];return o(n)?n:void 0}var o=n(75);t.exports=r},function(t,e){function n(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}t.exports=n},function(t,e,n){function r(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}var o=n(52),i=n(53),a=n(54),u=n(55),c=n(56);r.prototype.clear=o,r.prototype["delete"]=i,r.prototype.get=a,r.prototype.has=u,r.prototype.set=c,t.exports=r},function(t,e,n){function r(t,e){for(var n=t.length;n--;)if(o(t[n][0],e))return n;return-1}var o=n(71);t.exports=r},function(t,e,n){function r(t,e){var n=t.__data__;return o(e)?n["string"==typeof e?"string":"hash"]:n.map}var o=n(50);t.exports=r},function(t,e,n){var r=n(2),o=r(Object,"create");t.exports=o},function(t,e){function n(t){return!!t&&"object"==typeof t}t.exports=n},function(t,e){var n=Array.isArray;t.exports=n},function(t,e){function n(t){return"number"==typeof t&&t>-1&&t%1==0&&r>=t}var r=9007199254740991;t.exports=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(3),u=r(a),c=function(){function t(e,n){if(o(this,t),!(0,u["default"])(e))throw new Error("UnionSchema requires item schema to be an object.");if(!n||!n.schemaAttribute)throw new Error("UnionSchema requires schemaAttribute option.");this._itemSchema=e;var r=n.schemaAttribute;this._getSchema="function"==typeof r?r:function(t){return t[r]}}return i(t,[{key:"getItemSchema",value:function(){return this._itemSchema}},{key:"getSchemaKey",value:function(t){return this._getSchema(t)}}]),t}();e["default"]=c},function(t,e,n){var r=n(2),o=n(1),i=r(o,"Map");t.exports=i},function(t,e,n){function r(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}var o=n(57),i=n(58),a=n(59),u=n(60),c=n(61);r.prototype.clear=o,r.prototype["delete"]=i,r.prototype.get=a,r.prototype.has=u,r.prototype.set=c,t.exports=r},function(t,e,n){function r(t,e){return a.call(t,e)||"object"==typeof t&&e in t&&null===o(t)}var o=n(41),i=Object.prototype,a=i.hasOwnProperty;t.exports=r},function(t,e,n){function r(t,e,n,r,c,f){var s=c&u,p=t.length,l=e.length;if(p!=l&&!(s&&l>p))return!1;var v=f.get(t);if(v)return v==e;var h=-1,y=!0,_=c&a?new o:void 0;for(f.set(t,e);++h<p;){var d=t[h],b=e[h];if(r)var g=s?r(b,d,h,e,t,f):r(d,b,h,t,e,f);if(void 0!==g){if(g)continue;y=!1;break}if(_){if(!i(e,function(t,e){return _.has(e)||d!==t&&!n(d,t,r,c,f)?void 0:_.add(e)})){y=!1;break}}else if(d!==b&&!n(d,b,r,c,f)){y=!1;break}}return f["delete"](t),y}var o=n(26),i=n(31),a=1,u=2;t.exports=r},function(t,e){function n(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(n){}return e}t.exports=n},function(t,e){function n(t){if(null!=t){try{return r.call(t)}catch(e){}try{return t+""}catch(e){}}return""}var r=Function.prototype.toString;t.exports=n},function(t,e,n){function r(t){return null!=t&&a(o(t))&&!i(t)}var o=n(40),i=n(19),a=n(10);t.exports=r},function(t,e,n){function r(t){var e=o(t)?c.call(t):"";return e==i||e==a}var o=n(3),i="[object Function]",a="[object GeneratorFunction]",u=Object.prototype,c=u.toString;t.exports=r},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=function(){function t(e){var r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];if(n(this,t),!e||"string"!=typeof e)throw new Error("A string non-empty key is required");this._key=e,this._assignEntity=r.assignEntity;var o=r.idAttribute||"id";this._getId="function"==typeof o?o:function(t){return t[o]},this._idAttribute=o,this._meta=r.meta}return r(t,[{key:"getAssignEntity",value:function(){return this._assignEntity}},{key:"getKey",value:function(){return this._key}},{key:"getId",value:function(t){return this._getId(t)}},{key:"getIdAttribute",value:function(){return this._idAttribute}},{key:"getMeta",value:function(t){if(!t||"string"!=typeof t)throw new Error("A string non-empty property name is required");return this._meta&&this._meta[t]}},{key:"define",value:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e])}}]),t}();e["default"]=o},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(3),u=r(a),c=n(11),f=r(c),s=function(){function t(e){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];if(o(this,t),!(0,u["default"])(e))throw new Error("ArraySchema requires item schema to be an object.");if(n.schemaAttribute){var r=n.schemaAttribute;this._itemSchema=new f["default"](e,{schemaAttribute:r})}else this._itemSchema=e}return i(t,[{key:"getItemSchema",value:function(){return this._itemSchema}}]),t}();e["default"]=s},function(t,e,n){var r=n(2),o=n(1),i=r(o,"DataView");t.exports=i},function(t,e,n){function r(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}var o=n(43),i=n(44),a=n(45),u=n(46),c=n(47);r.prototype.clear=o,r.prototype["delete"]=i,r.prototype.get=a,r.prototype.has=u,r.prototype.set=c,t.exports=r},function(t,e,n){var r=n(2),o=n(1),i=r(o,"Promise");t.exports=i},function(t,e,n){var r=n(2),o=n(1),i=r(o,"Set");t.exports=i},function(t,e,n){function r(t){var e=-1,n=t?t.length:0;for(this.__data__=new o;++e<n;)this.add(t[e])}var o=n(13),i=n(63),a=n(64);r.prototype.add=r.prototype.push=i,r.prototype.has=a,t.exports=r},function(t,e,n){function r(t){this.__data__=new o(t)}var o=n(4),i=n(66),a=n(67),u=n(68),c=n(69),f=n(70);r.prototype.clear=i,r.prototype["delete"]=a,r.prototype.get=u,r.prototype.has=c,r.prototype.set=f,t.exports=r},function(t,e,n){var r=n(1),o=r.Symbol;t.exports=o},function(t,e,n){var r=n(1),o=r.Uint8Array;t.exports=o},function(t,e,n){var r=n(2),o=n(1),i=r(o,"WeakMap");t.exports=i},function(t,e){function n(t,e){for(var n=-1,r=t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}t.exports=n},function(t,e,n){function r(t,e,n,u,c){return t===e?!0:null==t||null==e||!i(t)&&!a(e)?t!==t&&e!==e:o(t,e,r,n,u,c)}var o=n(33),i=n(3),a=n(8);t.exports=r},function(t,e,n){function r(t,e,n,r,_,b){var g=f(t),j=f(e),x=h,m=h;g||(x=c(t),x=x==v?y:x),j||(m=c(e),m=m==v?y:m);var w=x==y&&!s(t),O=m==y&&!s(e),A=x==m;if(A&&!w)return b||(b=new o),g||p(t)?i(t,e,n,r,_,b):a(t,e,x,n,r,_,b);if(!(_&l)){var S=w&&d.call(t,"__wrapped__"),k=O&&d.call(e,"__wrapped__");if(S||k){var E=S?t.value():t,P=k?e.value():e;return b||(b=new o),n(E,P,r,_,b)}}return A?(b||(b=new o),u(t,e,n,r,_,b)):!1}var o=n(27),i=n(15),a=n(38),u=n(39),c=n(42),f=n(9),s=n(16),p=n(77),l=2,v="[object Arguments]",h="[object Array]",y="[object Object]",_=Object.prototype,d=_.hasOwnProperty;t.exports=r},function(t,e){function n(t){return r(Object(t))}var r=Object.keys;t.exports=n},function(t,e){function n(t){return function(e){return null==e?void 0:e[t]}}t.exports=n},function(t,e){function n(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}t.exports=n},function(t,e){function n(t){return t&&t.Object===Object?t:null}t.exports=n},function(t,e,n){function r(t,e,n,r,o,m,O){switch(n){case x:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case j:return!(t.byteLength!=e.byteLength||!r(new i(t),new i(e)));case p:case l:return+t==+e;case v:return t.name==e.name&&t.message==e.message;case y:return t!=+t?e!=+e:t==+e;case _:case b:return t==e+"";case h:var A=u;case d:var S=m&s;if(A||(A=c),t.size!=e.size&&!S)return!1;var k=O.get(t);return k?k==e:(m|=f,O.set(t,e),a(A(t),A(e),r,o,m,O));case g:if(w)return w.call(t)==w.call(e)}return!1}var o=n(28),i=n(29),a=n(15),u=n(62),c=n(65),f=1,s=2,p="[object Boolean]",l="[object Date]",v="[object Error]",h="[object Map]",y="[object Number]",_="[object RegExp]",d="[object Set]",b="[object String]",g="[object Symbol]",j="[object ArrayBuffer]",x="[object DataView]",m=o?o.prototype:void 0,w=m?m.valueOf:void 0;t.exports=r},function(t,e,n){function r(t,e,n,r,u,c){var f=u&a,s=i(t),p=s.length,l=i(e),v=l.length;if(p!=v&&!f)return!1;for(var h=p;h--;){var y=s[h];if(!(f?y in e:o(e,y)))return!1}var _=c.get(t);if(_)return _==e;var d=!0;c.set(t,e);for(var b=f;++h<p;){y=s[h];var g=t[y],j=e[y];if(r)var x=f?r(j,g,y,e,t,c):r(g,j,y,t,e,c);if(!(void 0===x?g===j||n(g,j,r,u,c):x)){d=!1;break}b||(b="constructor"==y)}if(d&&!b){var m=t.constructor,w=e.constructor;m!=w&&"constructor"in t&&"constructor"in e&&!("function"==typeof m&&m instanceof m&&"function"==typeof w&&w instanceof w)&&(d=!1)}return c["delete"](t),d}var o=n(14),i=n(78),a=2;t.exports=r},function(t,e,n){var r=n(35),o=r("length");t.exports=o},function(t,e){function n(t){return r(Object(t))}var r=Object.getPrototypeOf;t.exports=n},function(t,e,n){function r(t){return d.call(t)}var o=n(22),i=n(12),a=n(24),u=n(25),c=n(30),f=n(17),s="[object Map]",p="[object Object]",l="[object Promise]",v="[object Set]",h="[object WeakMap]",y="[object DataView]",_=Object.prototype,d=_.toString,b=f(o),g=f(i),j=f(a),x=f(u),m=f(c);(o&&r(new o(new ArrayBuffer(1)))!=y||i&&r(new i)!=s||a&&r(a.resolve())!=l||u&&r(new u)!=v||c&&r(new c)!=h)&&(r=function(t){var e=d.call(t),n=e==p?t.constructor:void 0,r=n?f(n):void 0;if(r)switch(r){case b:return y;case g:return s;case j:return l;case x:return v;case m:return h}return e}),t.exports=r},function(t,e,n){function r(){this.__data__=o?o(null):{}}var o=n(7);t.exports=r},function(t,e){function n(t){return this.has(t)&&delete this.__data__[t]}t.exports=n},function(t,e,n){function r(t){var e=this.__data__;if(o){var n=e[t];return n===i?void 0:n}return u.call(e,t)?e[t]:void 0}var o=n(7),i="__lodash_hash_undefined__",a=Object.prototype,u=a.hasOwnProperty;t.exports=r},function(t,e,n){function r(t){var e=this.__data__;return o?void 0!==e[t]:a.call(e,t)}var o=n(7),i=Object.prototype,a=i.hasOwnProperty;t.exports=r},function(t,e,n){function r(t,e){var n=this.__data__;return n[t]=o&&void 0===e?i:e,this}var o=n(7),i="__lodash_hash_undefined__";t.exports=r},function(t,e,n){function r(t){var e=t?t.length:void 0;return u(e)&&(a(t)||c(t)||i(t))?o(e,String):null}var o=n(36),i=n(72),a=n(9),u=n(10),c=n(76);t.exports=r},function(t,e){function n(t,e){return e=null==e?r:e,!!e&&("number"==typeof t||o.test(t))&&t>-1&&t%1==0&&e>t}var r=9007199254740991,o=/^(?:0|[1-9]\d*)$/;t.exports=n},function(t,e){function n(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}t.exports=n},function(t,e){function n(t){var e=t&&t.constructor,n="function"==typeof e&&e.prototype||r;return t===n}var r=Object.prototype;t.exports=n},function(t,e){function n(){this.__data__=[]}t.exports=n},function(t,e,n){function r(t){var e=this.__data__,n=o(e,t);if(0>n)return!1;var r=e.length-1;return n==r?e.pop():a.call(e,n,1),!0}var o=n(5),i=Array.prototype,a=i.splice;t.exports=r},function(t,e,n){function r(t){var e=this.__data__,n=o(e,t);return 0>n?void 0:e[n][1]}var o=n(5);t.exports=r},function(t,e,n){function r(t){return o(this.__data__,t)>-1}var o=n(5);t.exports=r},function(t,e,n){function r(t,e){var n=this.__data__,r=o(n,t);return 0>r?n.push([t,e]):n[r][1]=e,this}var o=n(5);t.exports=r},function(t,e,n){function r(){this.__data__={hash:new o,map:new(a||i),string:new o}}var o=n(23),i=n(4),a=n(12);t.exports=r},function(t,e,n){function r(t){return o(this,t)["delete"](t)}var o=n(6);t.exports=r},function(t,e,n){function r(t){return o(this,t).get(t)}var o=n(6);t.exports=r},function(t,e,n){function r(t){return o(this,t).has(t)}var o=n(6);t.exports=r},function(t,e,n){function r(t,e){return o(this,t).set(t,e),this}var o=n(6);t.exports=r},function(t,e){function n(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}t.exports=n},function(t,e){function n(t){return this.__data__.set(t,r),this}var r="__lodash_hash_undefined__";t.exports=n},function(t,e){function n(t){return this.__data__.has(t)}t.exports=n},function(t,e){function n(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}t.exports=n},function(t,e,n){function r(){this.__data__=new o}var o=n(4);t.exports=r},function(t,e){function n(t){return this.__data__["delete"](t)}t.exports=n},function(t,e){function n(t){return this.__data__.get(t)}t.exports=n},function(t,e){function n(t){return this.__data__.has(t)}t.exports=n},function(t,e,n){function r(t,e){var n=this.__data__;return n instanceof o&&n.__data__.length==a&&(n=this.__data__=new i(n.__data__)),n.set(t,e),this}var o=n(4),i=n(13),a=200;t.exports=r},function(t,e){function n(t,e){return t===e||t!==t&&e!==e}t.exports=n},function(t,e,n){function r(t){return o(t)&&u.call(t,"callee")&&(!f.call(t,"callee")||c.call(t)==i)}var o=n(73),i="[object Arguments]",a=Object.prototype,u=a.hasOwnProperty,c=a.toString,f=a.propertyIsEnumerable;t.exports=r},function(t,e,n){function r(t){return i(t)&&o(t)}var o=n(18),i=n(8);t.exports=r},function(t,e,n){function r(t,e){return o(t,e)}var o=n(32);t.exports=r},function(t,e,n){function r(t){if(!a(t))return!1;var e=o(t)||i(t)?v:f;return e.test(u(t))}var o=n(19),i=n(16),a=n(3),u=n(17),c=/[\\^$.*+?()[\]{}|]/g,f=/^\[object .+?Constructor\]$/,s=Object.prototype,p=Function.prototype.toString,l=s.hasOwnProperty,v=RegExp("^"+p.call(l).replace(c,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=r},function(t,e,n){function r(t){return"string"==typeof t||!o(t)&&i(t)&&c.call(t)==a}var o=n(9),i=n(8),a="[object String]",u=Object.prototype,c=u.toString;t.exports=r},function(t,e,n){function r(t){return i(t)&&o(t.length)&&!!M[z.call(t)]}var o=n(10),i=n(8),a="[object Arguments]",u="[object Array]",c="[object Boolean]",f="[object Date]",s="[object Error]",p="[object Function]",l="[object Map]",v="[object Number]",h="[object Object]",y="[object RegExp]",_="[object Set]",d="[object String]",b="[object WeakMap]",g="[object ArrayBuffer]",j="[object DataView]",x="[object Float32Array]",m="[object Float64Array]",w="[object Int8Array]",O="[object Int16Array]",A="[object Int32Array]",S="[object Uint8Array]",k="[object Uint8ClampedArray]",E="[object Uint16Array]",P="[object Uint32Array]",M={};M[x]=M[m]=M[w]=M[O]=M[A]=M[S]=M[k]=M[E]=M[P]=!0,M[a]=M[u]=M[g]=M[c]=M[j]=M[f]=M[s]=M[p]=M[l]=M[v]=M[h]=M[y]=M[_]=M[d]=M[b]=!1;var I=Object.prototype,z=I.toString;t.exports=r},function(t,e,n){function r(t){var e=f(t);if(!e&&!u(t))return i(t);var n=a(t),r=!!n,s=n||[],p=s.length;for(var l in t)!o(t,l)||r&&("length"==l||c(l,p))||e&&"constructor"==l||s.push(l);return s}var o=n(14),i=n(34),a=n(48),u=n(18),c=n(49),f=n(51);t.exports=r},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.normalizr=e():t.normalizr=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e,r){t[e]=r}function i(t,e,r,n){var i=n.assignEntity,a=void 0===i?o:i,u=e&&e.getDefaults&&e.getDefaults(),c=e&&e.getAssignEntity&&e.getAssignEntity(),f=(0,k["default"])(u)?d({},u):{};for(var s in t)if(t.hasOwnProperty(s)){var p=l(t[s],e[s],r,n);a.call(null,f,s,p,t,e),c&&c.call(null,f,s,p,t,e)}return f}function a(t,e,r,n){return function(t){return l(t,e,r,n)}}function u(t,e,r,n){return function(o){var i=t.getSchemaKey(o),a=l(o,e[i],r,n);return{id:a,schema:i}}}function c(t,e,r,n){var o=e.getItemSchema(),i=a(e,o,r,n);return Array.isArray(t)?t.map(i):Object.keys(t).reduce(function(e,r){return e[r]=i(t[r]),e},{})}function f(t,e,r,n){var o=e.getItemSchema();return u(e,o,r,n)(t)}function s(t,e,r){for(var n in e)e.hasOwnProperty(n)&&(t.hasOwnProperty(n)&&!(0,A["default"])(t[n],e[n])?console.warn("When merging two "+r+', found unequal data in their "'+n+'" values. Using the earlier value.',t[n],e[n]):t[n]=e[n])}function p(t,e,r,n){var o=n.mergeIntoEntity,a=void 0===o?s:o,u=e.getKey(),c=e.getId(t);r.hasOwnProperty(u)||(r[u]={}),r[u].hasOwnProperty(c)||(r[u][c]={});var f=r[u][c],p=i(t,e,r,n);return a(f,p,u),c}function l(t,e,r,n){return(0,k["default"])(t)&&(0,k["default"])(e)?e instanceof g["default"]?p(t,e,r,n):e instanceof x["default"]?c(t,e,r,n):e instanceof w["default"]?f(t,e,r,n):i(t,e,r,n):t}function v(t,e){return new x["default"](t,e)}function h(t,e){return new x["default"](t,e)}function y(t,e){return new w["default"](t,e)}function _(t,e){var r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];if(!(0,k["default"])(t))throw new Error("Normalize accepts an object or an array as its input.");if(!(0,k["default"])(e)||Array.isArray(e))throw new Error("Normalize accepts an object for schema.");var n={},o=l(t,e,n,r);return{entities:n,result:o}}Object.defineProperty(e,"__esModule",{value:!0}),e.Schema=void 0;var d=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t};e.arrayOf=v,e.valuesOf=h,e.unionOf=y,e.normalize=_;var b=r(20),g=n(b),j=r(21),x=n(j),m=r(11),w=n(m),O=r(74),A=n(O),S=r(3),k=n(S);e.Schema=g["default"]},function(t,e,r){(function(t,n){var o=r(37),i={"function":!0,object:!0},a=i[typeof e]&&e&&!e.nodeType?e:void 0,u=i[typeof t]&&t&&!t.nodeType?t:void 0,c=o(a&&u&&"object"==typeof n&&n),f=o(i[typeof self]&&self),s=o(i[typeof window]&&window),p=o(i[typeof this]&&this),l=c||s!==(p&&p.window)&&s||f||p||Function("return this")();t.exports=l}).call(e,r(79)(t),function(){return this}())},function(t,e,r){function n(t,e){var r=t[e];return o(r)?r:void 0}var o=r(75);t.exports=n},function(t,e){function r(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}t.exports=r},function(t,e,r){function n(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}var o=r(52),i=r(53),a=r(54),u=r(55),c=r(56);n.prototype.clear=o,n.prototype["delete"]=i,n.prototype.get=a,n.prototype.has=u,n.prototype.set=c,t.exports=n},function(t,e,r){function n(t,e){for(var r=t.length;r--;)if(o(t[r][0],e))return r;return-1}var o=r(71);t.exports=n},function(t,e,r){function n(t,e){var r=t.__data__;return o(e)?r["string"==typeof e?"string":"hash"]:r.map}var o=r(50);t.exports=n},function(t,e,r){var n=r(2),o=n(Object,"create");t.exports=o},function(t,e){function r(t){return!!t&&"object"==typeof t}t.exports=r},function(t,e){var r=Array.isArray;t.exports=r},function(t,e){function r(t){return"number"==typeof t&&t>-1&&t%1==0&&n>=t}var n=9007199254740991;t.exports=r},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=r(3),u=n(a),c=function(){function t(e,r){if(o(this,t),!(0,u["default"])(e))throw new Error("UnionSchema requires item schema to be an object.");if(!r||!r.schemaAttribute)throw new Error("UnionSchema requires schemaAttribute option.");this._itemSchema=e;var n=r.schemaAttribute;this._getSchema="function"==typeof n?n:function(t){return t[n]}}return i(t,[{key:"getItemSchema",value:function(){return this._itemSchema}},{key:"getSchemaKey",value:function(t){return this._getSchema(t)}}]),t}();e["default"]=c},function(t,e,r){var n=r(2),o=r(1),i=n(o,"Map");t.exports=i},function(t,e,r){function n(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}var o=r(57),i=r(58),a=r(59),u=r(60),c=r(61);n.prototype.clear=o,n.prototype["delete"]=i,n.prototype.get=a,n.prototype.has=u,n.prototype.set=c,t.exports=n},function(t,e,r){function n(t,e){return a.call(t,e)||"object"==typeof t&&e in t&&null===o(t)}var o=r(41),i=Object.prototype,a=i.hasOwnProperty;t.exports=n},function(t,e,r){function n(t,e,r,n,c,f){var s=c&u,p=t.length,l=e.length;if(p!=l&&!(s&&l>p))return!1;var v=f.get(t);if(v)return v==e;var h=-1,y=!0,_=c&a?new o:void 0;for(f.set(t,e);++h<p;){var d=t[h],b=e[h];if(n)var g=s?n(b,d,h,e,t,f):n(d,b,h,t,e,f);if(void 0!==g){if(g)continue;y=!1;break}if(_){if(!i(e,function(t,e){return _.has(e)||d!==t&&!r(d,t,n,c,f)?void 0:_.add(e)})){y=!1;break}}else if(d!==b&&!r(d,b,n,c,f)){y=!1;break}}return f["delete"](t),y}var o=r(26),i=r(31),a=1,u=2;t.exports=n},function(t,e){function r(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(r){}return e}t.exports=r},function(t,e){function r(t){if(null!=t){try{return n.call(t)}catch(e){}try{return t+""}catch(e){}}return""}var n=Function.prototype.toString;t.exports=r},function(t,e,r){function n(t){return null!=t&&a(o(t))&&!i(t)}var o=r(40),i=r(19),a=r(10);t.exports=n},function(t,e,r){function n(t){var e=o(t)?c.call(t):"";return e==i||e==a}var o=r(3),i="[object Function]",a="[object GeneratorFunction]",u=Object.prototype,c=u.toString;t.exports=n},function(t,e){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),o=function(){function t(e){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];if(r(this,t),!e||"string"!=typeof e)throw new Error("A string non-empty key is required");this._key=e,this._assignEntity=n.assignEntity;var o=n.idAttribute||"id";this._getId="function"==typeof o?o:function(t){return t[o]},this._idAttribute=o,this._meta=n.meta,this._defaults=n.defaults}return n(t,[{key:"getAssignEntity",value:function(){return this._assignEntity}},{key:"getKey",value:function(){return this._key}},{key:"getId",value:function(t){return this._getId(t)}},{key:"getIdAttribute",value:function(){return this._idAttribute}},{key:"getMeta",value:function(t){if(!t||"string"!=typeof t)throw new Error("A string non-empty property name is required");return this._meta&&this._meta[t]}},{key:"getDefaults",value:function(){return this._defaults}},{key:"define",value:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e])}}]),t}();e["default"]=o},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=r(3),u=n(a),c=r(11),f=n(c),s=function(){function t(e){var r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];if(o(this,t),!(0,u["default"])(e))throw new Error("ArraySchema requires item schema to be an object.");if(r.schemaAttribute){var n=r.schemaAttribute;this._itemSchema=new f["default"](e,{schemaAttribute:n})}else this._itemSchema=e}return i(t,[{key:"getItemSchema",value:function(){return this._itemSchema}}]),t}();e["default"]=s},function(t,e,r){var n=r(2),o=r(1),i=n(o,"DataView");t.exports=i},function(t,e,r){function n(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}var o=r(43),i=r(44),a=r(45),u=r(46),c=r(47);n.prototype.clear=o,n.prototype["delete"]=i,n.prototype.get=a,n.prototype.has=u,n.prototype.set=c,t.exports=n},function(t,e,r){var n=r(2),o=r(1),i=n(o,"Promise");t.exports=i},function(t,e,r){var n=r(2),o=r(1),i=n(o,"Set");t.exports=i},function(t,e,r){function n(t){var e=-1,r=t?t.length:0;for(this.__data__=new o;++e<r;)this.add(t[e])}var o=r(13),i=r(63),a=r(64);n.prototype.add=n.prototype.push=i,n.prototype.has=a,t.exports=n},function(t,e,r){function n(t){this.__data__=new o(t)}var o=r(4),i=r(66),a=r(67),u=r(68),c=r(69),f=r(70);n.prototype.clear=i,n.prototype["delete"]=a,n.prototype.get=u,n.prototype.has=c,n.prototype.set=f,t.exports=n},function(t,e,r){var n=r(1),o=n.Symbol;t.exports=o},function(t,e,r){var n=r(1),o=n.Uint8Array;t.exports=o},function(t,e,r){var n=r(2),o=r(1),i=n(o,"WeakMap");t.exports=i},function(t,e){function r(t,e){for(var r=-1,n=t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}t.exports=r},function(t,e,r){function n(t,e,r,u,c){return t===e?!0:null==t||null==e||!i(t)&&!a(e)?t!==t&&e!==e:o(t,e,n,r,u,c)}var o=r(33),i=r(3),a=r(8);t.exports=n},function(t,e,r){function n(t,e,r,n,_,b){var g=f(t),j=f(e),x=h,m=h;g||(x=c(t),x=x==v?y:x),j||(m=c(e),m=m==v?y:m);var w=x==y&&!s(t),O=m==y&&!s(e),A=x==m;if(A&&!w)return b||(b=new o),g||p(t)?i(t,e,r,n,_,b):a(t,e,x,r,n,_,b);if(!(_&l)){var S=w&&d.call(t,"__wrapped__"),k=O&&d.call(e,"__wrapped__");if(S||k){var E=S?t.value():t,P=k?e.value():e;return b||(b=new o),r(E,P,n,_,b)}}return A?(b||(b=new o),u(t,e,r,n,_,b)):!1}var o=r(27),i=r(15),a=r(38),u=r(39),c=r(42),f=r(9),s=r(16),p=r(77),l=2,v="[object Arguments]",h="[object Array]",y="[object Object]",_=Object.prototype,d=_.hasOwnProperty;t.exports=n},function(t,e){function r(t){return n(Object(t))}var n=Object.keys;t.exports=r},function(t,e){function r(t){return function(e){return null==e?void 0:e[t]}}t.exports=r},function(t,e){function r(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}t.exports=r},function(t,e){function r(t){return t&&t.Object===Object?t:null}t.exports=r},function(t,e,r){function n(t,e,r,n,o,m,O){switch(r){case x:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case j:return!(t.byteLength!=e.byteLength||!n(new i(t),new i(e)));case p:case l:return+t==+e;case v:return t.name==e.name&&t.message==e.message;case y:return t!=+t?e!=+e:t==+e;case _:case b:return t==e+"";case h:var A=u;case d:var S=m&s;if(A||(A=c),t.size!=e.size&&!S)return!1;var k=O.get(t);return k?k==e:(m|=f,O.set(t,e),a(A(t),A(e),n,o,m,O));case g:if(w)return w.call(t)==w.call(e)}return!1}var o=r(28),i=r(29),a=r(15),u=r(62),c=r(65),f=1,s=2,p="[object Boolean]",l="[object Date]",v="[object Error]",h="[object Map]",y="[object Number]",_="[object RegExp]",d="[object Set]",b="[object String]",g="[object Symbol]",j="[object ArrayBuffer]",x="[object DataView]",m=o?o.prototype:void 0,w=m?m.valueOf:void 0;t.exports=n},function(t,e,r){function n(t,e,r,n,u,c){var f=u&a,s=i(t),p=s.length,l=i(e),v=l.length;if(p!=v&&!f)return!1;for(var h=p;h--;){var y=s[h];if(!(f?y in e:o(e,y)))return!1}var _=c.get(t);if(_)return _==e;var d=!0;c.set(t,e);for(var b=f;++h<p;){y=s[h];var g=t[y],j=e[y];if(n)var x=f?n(j,g,y,e,t,c):n(g,j,y,t,e,c);if(!(void 0===x?g===j||r(g,j,n,u,c):x)){d=!1;break}b||(b="constructor"==y)}if(d&&!b){var m=t.constructor,w=e.constructor;m!=w&&"constructor"in t&&"constructor"in e&&!("function"==typeof m&&m instanceof m&&"function"==typeof w&&w instanceof w)&&(d=!1)}return c["delete"](t),d}var o=r(14),i=r(78),a=2;t.exports=n},function(t,e,r){var n=r(35),o=n("length");t.exports=o},function(t,e){function r(t){return n(Object(t))}var n=Object.getPrototypeOf;t.exports=r},function(t,e,r){function n(t){return d.call(t)}var o=r(22),i=r(12),a=r(24),u=r(25),c=r(30),f=r(17),s="[object Map]",p="[object Object]",l="[object Promise]",v="[object Set]",h="[object WeakMap]",y="[object DataView]",_=Object.prototype,d=_.toString,b=f(o),g=f(i),j=f(a),x=f(u),m=f(c);(o&&n(new o(new ArrayBuffer(1)))!=y||i&&n(new i)!=s||a&&n(a.resolve())!=l||u&&n(new u)!=v||c&&n(new c)!=h)&&(n=function(t){var e=d.call(t),r=e==p?t.constructor:void 0,n=r?f(r):void 0;if(n)switch(n){case b:return y;case g:return s;case j:return l;case x:return v;case m:return h}return e}),t.exports=n},function(t,e,r){function n(){this.__data__=o?o(null):{}}var o=r(7);t.exports=n},function(t,e){function r(t){return this.has(t)&&delete this.__data__[t]}t.exports=r},function(t,e,r){function n(t){var e=this.__data__;if(o){var r=e[t];return r===i?void 0:r}return u.call(e,t)?e[t]:void 0}var o=r(7),i="__lodash_hash_undefined__",a=Object.prototype,u=a.hasOwnProperty;t.exports=n},function(t,e,r){function n(t){var e=this.__data__;return o?void 0!==e[t]:a.call(e,t)}var o=r(7),i=Object.prototype,a=i.hasOwnProperty;t.exports=n},function(t,e,r){function n(t,e){var r=this.__data__;return r[t]=o&&void 0===e?i:e,this}var o=r(7),i="__lodash_hash_undefined__";t.exports=n},function(t,e,r){function n(t){var e=t?t.length:void 0;return u(e)&&(a(t)||c(t)||i(t))?o(e,String):null}var o=r(36),i=r(72),a=r(9),u=r(10),c=r(76);t.exports=n},function(t,e){function r(t,e){return e=null==e?n:e,!!e&&("number"==typeof t||o.test(t))&&t>-1&&t%1==0&&e>t}var n=9007199254740991,o=/^(?:0|[1-9]\d*)$/;t.exports=r},function(t,e){function r(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}t.exports=r},function(t,e){function r(t){var e=t&&t.constructor,r="function"==typeof e&&e.prototype||n;return t===r}var n=Object.prototype;t.exports=r},function(t,e){function r(){this.__data__=[]}t.exports=r},function(t,e,r){function n(t){var e=this.__data__,r=o(e,t);if(0>r)return!1;var n=e.length-1;return r==n?e.pop():a.call(e,r,1),!0}var o=r(5),i=Array.prototype,a=i.splice;t.exports=n},function(t,e,r){function n(t){var e=this.__data__,r=o(e,t);return 0>r?void 0:e[r][1]}var o=r(5);t.exports=n},function(t,e,r){function n(t){return o(this.__data__,t)>-1}var o=r(5);t.exports=n},function(t,e,r){function n(t,e){var r=this.__data__,n=o(r,t);return 0>n?r.push([t,e]):r[n][1]=e,this}var o=r(5);t.exports=n},function(t,e,r){function n(){this.__data__={hash:new o,map:new(a||i),string:new o}}var o=r(23),i=r(4),a=r(12);t.exports=n},function(t,e,r){function n(t){return o(this,t)["delete"](t)}var o=r(6);t.exports=n},function(t,e,r){function n(t){return o(this,t).get(t)}var o=r(6);t.exports=n},function(t,e,r){function n(t){return o(this,t).has(t)}var o=r(6);t.exports=n},function(t,e,r){function n(t,e){return o(this,t).set(t,e),this}var o=r(6);t.exports=n},function(t,e){function r(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}t.exports=r},function(t,e){function r(t){return this.__data__.set(t,n),this}var n="__lodash_hash_undefined__";t.exports=r},function(t,e){function r(t){return this.__data__.has(t)}t.exports=r},function(t,e){function r(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=t}),r}t.exports=r},function(t,e,r){function n(){this.__data__=new o}var o=r(4);t.exports=n},function(t,e){function r(t){return this.__data__["delete"](t)}t.exports=r},function(t,e){function r(t){return this.__data__.get(t)}t.exports=r},function(t,e){function r(t){return this.__data__.has(t)}t.exports=r},function(t,e,r){function n(t,e){var r=this.__data__;return r instanceof o&&r.__data__.length==a&&(r=this.__data__=new i(r.__data__)),r.set(t,e),this}var o=r(4),i=r(13),a=200;t.exports=n},function(t,e){function r(t,e){return t===e||t!==t&&e!==e}t.exports=r},function(t,e,r){function n(t){return o(t)&&u.call(t,"callee")&&(!f.call(t,"callee")||c.call(t)==i)}var o=r(73),i="[object Arguments]",a=Object.prototype,u=a.hasOwnProperty,c=a.toString,f=a.propertyIsEnumerable;t.exports=n},function(t,e,r){function n(t){return i(t)&&o(t)}var o=r(18),i=r(8);t.exports=n},function(t,e,r){function n(t,e){return o(t,e)}var o=r(32);t.exports=n},function(t,e,r){function n(t){if(!a(t))return!1;var e=o(t)||i(t)?v:f;return e.test(u(t))}var o=r(19),i=r(16),a=r(3),u=r(17),c=/[\\^$.*+?()[\]{}|]/g,f=/^\[object .+?Constructor\]$/,s=Object.prototype,p=Function.prototype.toString,l=s.hasOwnProperty,v=RegExp("^"+p.call(l).replace(c,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=n},function(t,e,r){function n(t){return"string"==typeof t||!o(t)&&i(t)&&c.call(t)==a}var o=r(9),i=r(8),a="[object String]",u=Object.prototype,c=u.toString;t.exports=n},function(t,e,r){function n(t){return i(t)&&o(t.length)&&!!M[z.call(t)]}var o=r(10),i=r(8),a="[object Arguments]",u="[object Array]",c="[object Boolean]",f="[object Date]",s="[object Error]",p="[object Function]",l="[object Map]",v="[object Number]",h="[object Object]",y="[object RegExp]",_="[object Set]",d="[object String]",b="[object WeakMap]",g="[object ArrayBuffer]",j="[object DataView]",x="[object Float32Array]",m="[object Float64Array]",w="[object Int8Array]",O="[object Int16Array]",A="[object Int32Array]",S="[object Uint8Array]",k="[object Uint8ClampedArray]",E="[object Uint16Array]",P="[object Uint32Array]",M={};M[x]=M[m]=M[w]=M[O]=M[A]=M[S]=M[k]=M[E]=M[P]=!0,M[a]=M[u]=M[g]=M[c]=M[j]=M[f]=M[s]=M[p]=M[l]=M[v]=M[h]=M[y]=M[_]=M[d]=M[b]=!1;var I=Object.prototype,z=I.toString;t.exports=n},function(t,e,r){function n(t){var e=f(t);if(!e&&!u(t))return i(t);var r=a(t),n=!!r,s=r||[],p=s.length;for(var l in t)!o(t,l)||n&&("length"==l||c(l,p))||e&&"constructor"==l||s.push(l);return s}var o=r(14),i=r(34),a=r(48),u=r(18),c=r(49),f=r(51);t.exports=n},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}}])}); |
@@ -30,2 +30,3 @@ 'use strict'; | ||
this._meta = options.meta; | ||
this._defaults = options.defaults; | ||
} | ||
@@ -62,2 +63,7 @@ | ||
}, { | ||
key: 'getDefaults', | ||
value: function getDefaults() { | ||
return this._defaults; | ||
} | ||
}, { | ||
key: 'define', | ||
@@ -64,0 +70,0 @@ value: function define(nestedSchema) { |
@@ -7,2 +7,5 @@ 'use strict'; | ||
exports.Schema = undefined; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
exports.arrayOf = arrayOf; | ||
@@ -44,6 +47,7 @@ exports.valuesOf = valuesOf; | ||
var normalized = {}; | ||
var defaults = schema && schema.getDefaults && schema.getDefaults(); | ||
var schemaAssignEntity = schema && schema.getAssignEntity && schema.getAssignEntity(); | ||
var normalized = (0, _isObject2.default)(defaults) ? _extends({}, defaults) : {}; | ||
for (var key in obj) { | ||
if (obj.hasOwnProperty(key)) { | ||
var schemaAssignEntity = schema && schema.getAssignEntity && schema.getAssignEntity(); | ||
var entity = visit(obj[key], schema[key], bag, options); | ||
@@ -50,0 +54,0 @@ assignEntity.call(null, normalized, key, entity, obj, schema); |
{ | ||
"name": "normalizr", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Normalizes JSON according to schema for Redux and Flux applications", | ||
"main": "lib/index.js", | ||
"typings": "index.d.ts", | ||
"repository": { | ||
@@ -47,2 +48,4 @@ "type": "git", | ||
"rimraf": "^2.4.2", | ||
"typescript": "^1.8.10", | ||
"typescript-definition-tester": "0.0.4", | ||
"webpack": "^1.13.0" | ||
@@ -49,0 +52,0 @@ }, |
@@ -14,2 +14,3 @@ export default class EntitySchema { | ||
this._meta = options.meta; | ||
this._defaults = options.defaults; | ||
} | ||
@@ -39,2 +40,6 @@ | ||
} | ||
getDefaults() { | ||
return this._defaults; | ||
} | ||
@@ -41,0 +46,0 @@ define(nestedSchema) { |
@@ -14,6 +14,7 @@ import EntitySchema from './EntitySchema'; | ||
let normalized = {}; | ||
const defaults = schema && schema.getDefaults && schema.getDefaults(); | ||
const schemaAssignEntity = schema && schema.getAssignEntity && schema.getAssignEntity(); | ||
let normalized = isObject(defaults) ? { ...defaults } : {}; | ||
for (let key in obj) { | ||
if (obj.hasOwnProperty(key)) { | ||
const schemaAssignEntity = schema && schema.getAssignEntity && schema.getAssignEntity(); | ||
const entity = visit(obj[key], schema[key], bag, options); | ||
@@ -20,0 +21,0 @@ assignEntity.call(null, normalized, key, entity, obj, schema); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
474
39338
12
11
1
0