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

@neoskop/adamant

Package Overview
Dependencies
Maintainers
11
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@neoskop/adamant - npm Package Compare versions

Comparing version 0.3.0-rc.5 to 0.3.0-rc.6

2

bundles/neoskop-adamant.umd.min.js

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("reflect-metadata"),require("@angular/core"),require("fast-deep-equal"),require("rxjs/internal/Observable")):"function"==typeof define&&define.amd?define("@neoskop/adamant",["exports","reflect-metadata","@angular/core","fast-deep-equal","rxjs/internal/Observable"],e):e((t.neoskop=t.neoskop||{},t.neoskop.adamant={}),null,t.ng.core,t.fastDeepEqual,t.rxjs["internal/Observable"])}(this,function(t,e,r,n,i){"use strict";var o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function a(t,e){function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var u=function(){return(u=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function m(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&(r[n[i]]=t[n[i]])}return r}function l(e,a,u,s){return new(u||(u=Promise))(function(t,r){function n(t){try{o(s.next(t))}catch(e){r(e)}}function i(t){try{o(s["throw"](t))}catch(e){r(e)}}function o(e){e.done?t(e.value):new u(function(t){t(e.value)}).then(n,i)}o((s=s.apply(e,a||[])).next())})}function I(n,i){var o,a,u,t,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return t={next:e(0),"throw":e(1),"return":e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function r(t){if(o)throw new TypeError("Generator is already executing.");for(;s;)try{if(o=1,a&&(u=2&t[0]?a["return"]:t[0]?a["throw"]||((u=a["return"])&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,u&&(t=[2&t[0],u.value]),t[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3])){s.label=t[1];break}if(6===t[0]&&s.label<u[1]){s.label=u[1],u=t;break}if(u&&s.label<u[2]){s.label=u[2],s.ops.push(t);break}u[2]&&s.ops.pop(),s.trys.pop();continue}t=i.call(n,s)}catch(e){t=[6,e],a=0}finally{o=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([e,t])}}}function E(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function A(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),a=[];try{for(;(void 0===e||0<e--)&&!(n=o.next()).done;)a.push(n.value)}catch(u){i={error:u}}finally{try{n&&!n.done&&(r=o["return"])&&r.call(o)}finally{if(i)throw i.error}}return a}function s(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(A(arguments[e]));return t}var c="__adamant_class_metadata",d="__adamant_property_metadata";function g(t,e){return t.hasOwnProperty(c)?t[c].filter(function(t){return!e||t instanceof e}):[]}function f(t,e){t.hasOwnProperty(c)||p(t,c,[]),t[c].push(e)}function O(t){return t.hasOwnProperty(d)?t[d]:new Map}function h(t,e,r){t.hasOwnProperty(d)||p(t,d,new Map),t[d].has(e)||t[d].set(e,[]),t[d].get(e).push(r)}function p(t,e,r){Object.defineProperty(t,e,{value:r})}function y(t,e){var r,n;try{for(var i=E(Object.keys(e)),o=i.next();!o.done;o=i.next()){var a=o.value;t[a]=e[a]}}catch(u){r={error:u}}finally{try{o&&!o.done&&(n=i["return"])&&n.call(i)}finally{if(r)throw r.error}}return t}var v=r.InjectionToken;function w(){throw new Error('Dependency Injection implementation missing, provide "@angular/core" or "injection-js"')}var _=new v("ADAMANT_INJECTOR"),b=new v("ADAMANT_INJECTOR_FACTORY");function M(t){return t.__forward_ref__=M,t}function T(t){return"function"==typeof t&&t.hasOwnProperty("__forward_ref__")&&t.__forward_ref__===M?t():t}var x=null;function C(t){x=t}function D(t){if(x)return x(t);if(!1===x)throw w();try{var e=j(t);return C(j),e}catch(r){try{e=N(t);return C(N),e}catch(n){throw C(!1),w()}}}function j(t){var e=t.providers,r=t.parent,n=require("@angular/core").Injector;return n.create({parent:r,providers:s(e,[{provide:_,useExisting:n},{provide:b,useValue:j}])})}function N(t){var e=t.providers,r=t.parent,n=require("injection-js"),i=n.Injector;return n.ReflectiveInjector.resolveAndCreate(s(e,[{provide:_,useExisting:i},{provide:b,useValue:N}]),r)}var R=function(){function t(){}return t.prototype.validate=function(t,e){if(this.required&&null==t)throw new Error('Property "'+("symbol"==typeof e?Symbol.keyFor(e):e)+'" required')},t}();var P=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return T(this._type)},set:function(t){this._type=t},enumerable:!0,configurable:!0}),e}(R),k=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e}(P);var S=function Mt(){};var q=function Tt(){};var F=function xt(){};var V=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e}(P);var B=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e}(P);var Y={Static:"static",Uuid:"uuid"},U=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),Object.defineProperty(e.prototype,"required",{get:function(){return this.strategy===Y.Static},enumerable:!0,configurable:!0}),e}(R);var H=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e}(P);var J=function Ct(){};var L=function Dt(){};var Q=function jt(){};function K(){var r,n,t=new Promise(function(t,e){r=t,n=e});return Object.assign(t,{resolve:r,reject:n})}function $(t){return Object.defineProperty(t,"_deleted",{configurable:!0,value:!0}),t}function G(t,e){return Object.defineProperty(t,"_id",{configurable:!0,value:e.id}),Object.defineProperty(t,"_rev",{configurable:!0,value:e.rev}),t}function W(){return Array.from(new Array(36),function(t,e){if(8===e||13===e||18===e||23===e)return"-";var r=16*Math.random()|0;return 14==e&&(r=1+(5*Math.random()|0)),19===e&&(r=3&r|8),r.toString(16)}).join("")}var z=function It(){},X=new v("ADAMANT_CONNECTION"),Z=new v("ADAMANT_ENTITY_CLASS"),tt=new v("ADAMANT_ENTITY_METADATA"),et=new v("ADAMANT_EQUAL_CHECKER"),rt=new v("ADAMANT_CONNECTION_FACTORY"),nt=new v("ADAMANT_ID"),it=function Et(){},ot={Create:"create",Update:"update",Delete:"delete"},at=function(){function t(t,e,r,n,i){this.db=t,this.entityClass=e,this.metadata=r,this.hydrator=n,this.validator=i}return t.prototype.bulk=function(o,a){return l(this,void 0,void 0,function(){var e,r,n,i=this;return I(this,function(t){switch(t.label){case 0:return 0===o.length?[2,o]:[4,Promise.all(o.map(function(r){return l(i,void 0,void 0,function(){var e;return I(this,function(t){switch(t.label){case 0:if(!(r instanceof this.entityClass))throw new Error('Entity "'+r+'" is not instanceof '+this.entityClass.name);return[4,this.validator.validate(r)];case 1:return t.sent(),e=this.hydrator.dehydrate(r,{includeRev:a===ot.Update||a===ot.Delete}),a===ot.Delete&&(e._deleted=!0),[2,e]}})})}))];case 1:return e=t.sent(),[4,this.db.bulkDocs(e)];case 2:if(r=t.sent(),0<(n=r.filter(function(t){return Object.prototype.hasOwnProperty.call(t,"error")})).length)throw n;return r.forEach(function(t,e){a===ot.Delete&&$(o[e]),G(o[e],t)}),[2,o]}})})},t.prototype.create=function(t){return this.bulk(t,ot.Create)},t.prototype.update=function(t){return this.bulk(t,ot.Update)},t.prototype["delete"]=function(t){return this.bulk(t,ot.Delete)},t}(),ut={provide:at,useFactory:function(t,e,r,n,i){return new at(t,e,r,n,i)},deps:[X,Z,tt,z,it]};function st(){return n}function ct(){return{head:function(t){return t+"_0"},tail:function(t){return t+"_9"},build:function(t,e,r){if(e===String)return t+"_2_"+r;if(e!==Number)throw new Error('Invalid id type "'+e+'"');var n=r.toString();return t+"_1_"+"0".repeat(16-n.length)+n},parse:function(t){var e=/^(.*)_(1|2)_(.*)$/.exec(t);if(!e)throw new TypeError('Invalid id "'+t+'"');return{name:e[1],type:"2"===e[2]?String:Number,id:"2"===e[2]?e[3]:Number.parseInt(e[3],10)}}}}var lt=function(i){function t(t,e,r){var n=i.call(this)||this;return n.id=t,n.metadata=e,n.connectionManager=r,n}return a(t,i),t.prototype.dehydrate=function(_,t){var e,r,m=this,b={};t&&t.includeRev&&(b._rev=_._rev),this.metadata.attachments&&_._attachments&&(b._attachments=_._attachments);var n=function(t,e){var r,n,i,o,a=_[t];if(e instanceof P)if(null!=a){var u=g.connectionManager.getMetadata(e.type);if(e instanceof V||e instanceof B)try{for(var s=E(u.properties),c=s.next();!c.done;c=s.next()){var l=A(c.value,2),d=l[0],f=l[1];if(f instanceof k&&f.type===g.metadata.entity)try{for(var h=E(e instanceof V?a:Object.values(a)),p=h.next();!p.done;p=h.next()){p.value[d]=_}}catch(v){i={error:v}}finally{try{p&&!p.done&&(o=h["return"])&&o.call(h)}finally{if(i)throw i.error}}}}catch(w){r={error:w}}finally{try{c&&!c.done&&(n=s["return"])&&n.call(s)}finally{if(r)throw r.error}}if(e instanceof k)b[t]=ft(a,u,g.id);else if(e instanceof V)b[t]=a.map(function(t){return ft(t,u,m.id)});else if(e instanceof B){var y={};for(var d in a)y[d]=ft(a[d],u,g.id);b[t]=y}else e instanceof H&&(b[t]=g.connectionManager.getRepository(e.type).hydrator.dehydrate(a))}else null!=e["default"]&&(_[t]=b[t]=e["default"]);else e instanceof R&&(e instanceof U&&(a||e.strategy!==Y.Uuid||(_[t]=a=W()),b._id=g.id.build(g.metadata.name,g.metadata.idType,a)),undefined===a&&undefined!==e["default"]&&(_[t]=a=e["default"]),b[t]=a);undefined===b[t]&&delete b[t]},g=this;try{for(var i=E(this.metadata.properties),o=i.next();!o.done;o=i.next()){var a=A(o.value,2);n(a[0],a[1])}}catch(u){e={error:u}}finally{try{o&&!o.done&&(r=i["return"])&&r.call(i)}finally{if(e)throw e.error}}return b},t.prototype.hydrate=function(x,C,t){var e=void 0===t?{}:t,r=e.depth,D=void 0===r?Infinity:r,n=e.circularCache,j=void 0===n?{}:n;return l(this,void 0,void 0,function(){var e,r,n,T,i,o,a,u,s,c;return I(this,function(t){switch(t.label){case 0:if(C._id in j)return[2,j[C._id]];G(j[C._id]=x,{id:C._id,rev:C._rev}),this.metadata.attachments&&Object.defineProperty(x,"_attachments",{configurable:!0,value:C._attachments}),n=function(n,i){var o,a,u,s,c,l,d,f,h,p,y,v,w,_,m,b,g,A,O,M;return I(this,function(t){switch(t.label){case 0:return null!=(u=C[n])?[3,1]:(x[n]=null!=i["default"]?i["default"]:null,[3,13]);case 1:return i instanceof P?(s=T.connectionManager.getRepository(i.type),i instanceof k?(c=x,l=n,j.hasOwnProperty(u)?(d=j[u],[3,4]):[3,2]):[3,5]):[3,12];case 2:return[4,s._read(u,{depth:D-1,circularCache:j})];case 3:d=t.sent(),t.label=4;case 4:return c[l]=d,[3,11];case 5:return i instanceof V?(f=x,h=n,[4,dt(s,u,D-1,j)]):[3,7];case 6:return f[h]=t.sent(),[3,11];case 7:return i instanceof B?(p=Object.keys(u),y=p.map(function(t){return u[t]}),[4,dt(s,y,D-1,j)]):[3,9];case 8:v=t.sent(),w={},_=function(e){w[e]=v.find(function(t){return t._id===u[e]})};try{for(m=E(p),b=m.next();!b.done;b=m.next())g=b.value,_(g)}catch(e){o={error:e}}finally{try{b&&!b.done&&(a=m["return"])&&a.call(m)}finally{if(o)throw o.error}}return x[n]=w,[3,11];case 9:return i instanceof H?(A=x,O=n,[4,s.hydrator.hydrate(s.build(),u)]):[3,11];case 10:A[O]=t.sent(),t.label=11;case 11:return[3,13];case 12:i instanceof R&&(!(M=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(x),n))||M.writable||M.set)&&(x[n]=function r(t,e){if(e===Date&&t)return new Date(t);return t}(u,i.type)),t.label=13;case 13:return[2]}})},T=this,t.label=1;case 1:t.trys.push([1,6,7,8]),i=E(this.metadata.properties),o=i.next(),t.label=2;case 2:return o.done?[3,5]:(a=A(o.value,2),u=a[0],s=a[1],[5,n(u,s)]);case 3:t.sent(),t.label=4;case 4:return o=i.next(),[3,2];case 5:return[3,8];case 6:return c=t.sent(),e={error:c},[3,8];case 7:try{o&&!o.done&&(r=i["return"])&&r.call(i)}finally{if(e)throw e.error}return[7];case 8:return[2,x]}})})},t}(z);function dt(n,i,o,a){return l(this,void 0,void 0,function(){var e,r;return I(this,function(t){switch(t.label){case 0:return(e=i.filter(function(t){return!a.hasOwnProperty(t)})).length?[4,n._readAll({keys:e,include_docs:!0},{depth:o,circularCache:a})]:[3,2];case 1:r=t.sent(),t.label=2;case 2:return[2,i.map(function(e){return a.hasOwnProperty(e)?a[e]:r&&r.find(function(t){return t._id===e})})]}})})}function ft(t,e,r){return"string"==typeof t?t:r.build(e.name,e.idType,t[e.id])}var ht=new WeakMap,pt=new WeakMap,yt=function(){function e(t){this.entity=t,this.inline=!1,this.properties=new Map,this.parse(),this.assert()}return e.create=function(t){return ht.has(t)||ht.set(t,new e(t)),ht.get(t)},e.prototype.parse=function(){var t,e,r,n,i,o,a=g(this.entity),u=O(this.entity);try{for(var s=E(a),c=s.next();!c.done;c=s.next()){((w=c.value)instanceof q||w instanceof J)&&Object.assign(this,w)}}catch(_){t={error:_}}finally{try{c&&!c.done&&(e=s["return"])&&e.call(s)}finally{if(t)throw t.error}}try{for(var l=E(u),d=l.next();!d.done;d=l.next()){var f=A(d.value,2),h=f[0],p=f[1];try{for(var y=E(p),v=y.next();!v.done;v=y.next()){var w;(w=v.value)instanceof U&&(this.id=h,this.idType=w.type,this.idStrategy=w.strategy),w instanceof R&&this.properties.set(h,w)}}catch(m){i={error:m}}finally{try{v&&!v.done&&(o=y["return"])&&o.call(y)}finally{if(i)throw i.error}}}}catch(b){r={error:b}}finally{try{d&&!d.done&&(n=l["return"])&&n.call(l)}finally{if(r)throw r.error}}},e.prototype.assert=function(){var t,e;try{for(var r=E(this.inline?[]:["id","idStrategy","name","attachments"]),n=r.next();!n.done;n=r.next()){var i=n.value;if(null==this[i])throw new Error("Missing metadata '"+i+"' for entity \""+this.entity.name+'"')}}catch(o){t={error:o}}finally{try{n&&!n.done&&(e=r["return"])&&e.call(r)}finally{if(t)throw t.error}}},e}(),vt=function(){function e(t){this.designDoc=t,this.views=new Set,this.filters=new Set,this.parse(),this.assert()}return e.create=function(t){return pt.has(t)||pt.set(t,new e(t)),pt.get(t)},e.prototype.parse=function(){var t,e,r,n,i,o,a=g(this.designDoc),u=O(this.designDoc);try{for(var s=E(a),c=s.next();!c.done;c=s.next()){(w=c.value)instanceof S&&(Object.assign(this,w),this.name||(this.name=yt.create(this.entity).name))}}catch(_){t={error:_}}finally{try{c&&!c.done&&(e=s["return"])&&e.call(s)}finally{if(t)throw t.error}}try{for(var l=E(u),d=l.next();!d.done;d=l.next()){var f=A(d.value,2),h=f[0],p=f[1];try{for(var y=E(p),v=y.next();!v.done;v=y.next()){var w;(w=v.value)instanceof Q&&this.views.add(h),w instanceof F&&this.filters.add(h),w instanceof L&&(this.validateDoc=h)}}catch(m){i={error:m}}finally{try{v&&!v.done&&(o=y["return"])&&o.call(y)}finally{if(i)throw i.error}}}}catch(b){r={error:b}}finally{try{d&&!d.done&&(n=l["return"])&&n.call(l)}finally{if(r)throw r.error}}},e.prototype.assert=function(){var t,e;try{for(var r=E(["entity"]),n=r.next();!n.done;n=r.next()){var i=n.value;if(null==this[i])throw new Error("Missing metadata '"+i+"' for design doc \""+this.designDoc.name+'"')}}catch(o){t={error:o}}finally{try{n&&!n.done&&(e=r["return"])&&e.call(r)}finally{if(t)throw t.error}}},e}(),wt=function(){function t(t,e,r){this.repository=t,this._selector={},this._sort=[],this._selector._id={$gt:e,$lt:r}}return t.prototype.selector=function(t,e){if("string"==typeof t)"object"!=typeof e&&(e={$eq:e}),t in this._selector?Object.assign(this._selector[t],e):this._selector[t]=e;else for(var r in t)this.selector(r,t[r]);return this},t.prototype.sort=function(t,e){var r;return"string"==typeof t&&e?this._sort.push(((r={})[t]=e,r)):this._sort.push(t),this},t.prototype.limit=function(t){return this._limit=t,this},t.prototype.skip=function(t){return this._skip=t,this},t.prototype.resolve=function(t){return this.repository.executeQuery(this,t)},t.prototype.toFindRequest=function(){var t={selector:this._selector};return 0<this._sort.length&&(t.sort=this._sort),null!=this._limit&&(t.limit=this._limit),null!=this._skip&&(t.skip=this._skip),t},t}(),_t=function(){function t(t){this.db=t,this.queue=[],this.nextTick="undefined"!=typeof process&&process&&process.nextTick instanceof Function?process.nextTick:"undefined"!=typeof setImmediate?setImmediate:setTimeout}return t.prototype.read=function(t){var e;return(e=this.queue).push.apply(e,s(t)),this.schedule().then(function(e){return t.map(function(t){return e.get(t)}).filter(Boolean).map(function(t){return JSON.parse(JSON.stringify(t))})})},t.prototype.schedule=function(){var t=this;return this.deffered||(this.nextTick(function(){t.execute()}),this.deffered=K()),this.deffered},t.prototype.execute=function(){return l(this,void 0,void 0,function(){var e,r,n,i;return I(this,function(t){switch(t.label){case 0:e=this.queue.filter(function(t,e,r){return e===r.indexOf(t)}),this.queue=[],r=this.deffered,delete this.deffered,t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.db.allDocs({include_docs:!0,keys:e})];case 2:return n=t.sent().rows,r.resolve(new Map(n.map(function(t){return t.doc}).filter(Boolean).map(function(t){return[t._id,t]}))),[3,4];case 3:return i=t.sent(),r.reject(i),[3,4];case 4:return[2]}})})},t}(),mt=function(){function t(t,e,r,n,i,o,a,u){var s=this;this.db=t,this.entityClass=e,this.metadata=r,this.equal=n,this.adamantId=i,this.bulk=o,this.hydrator=a,this.validator=u,this.id={head:function(){return s.adamantId.head(s.metadata.name)},tail:function(){return s.adamantId.tail(s.metadata.name)},build:function(t){return s.adamantId.build(s.metadata.name,s.metadata.idType,t)},parse:function(t){return s.adamantId.parse(t)}},this.queryBatcher=new _t(this.db)}return t.prototype.getConnection=function(){return this.db},t.prototype.create=function(n){return l(this,void 0,void 0,function(){var e,r;return I(this,function(t){switch(t.label){case 0:return[4,this.validator.validate(n)];case 1:return t.sent(),e=this.hydrator.dehydrate(n),[4,this.db.put(e)];case 2:return r=t.sent(),G(n,r),[2,n]}})})},t.prototype.upsert=function(n){return l(this,void 0,void 0,function(){var e,r;return I(this,function(t){switch(t.label){case 0:return[4,this.validator.validate(n)];case 1:return t.sent(),e=this.hydrator.dehydrate(n),[4,this._upsert(this.id.build(n[this.metadata.id]),e)];case 2:return r=t.sent(),G(n,r),[2,n]}})})},t.prototype._upsert=function(t,o){var a=this;return this.db.upsert(t,function(t){var e=o,r=(e._id,e._rev,m(e,["_id","_rev"])),n=t,i=(n._id,n._rev,m(n,["_id","_rev"]));return!a.equal(r,i)&&o})},t.prototype.update=function(n){return l(this,void 0,void 0,function(){var e,r;return I(this,function(t){switch(t.label){case 0:return[4,this.validator.validate(n)];case 1:return t.sent(),e=this.hydrator.dehydrate(n,{includeRev:!0}),[4,this.db.put(e)];case 2:return r=t.sent(),G(n,r),[2,n]}})})},t.prototype["delete"]=function(n){return l(this,void 0,void 0,function(){var e,r;return I(this,function(t){switch(t.label){case 0:return[4,this.validator.validate(n)];case 1:return t.sent(),(e=this.hydrator.dehydrate(n,{includeRev:!0}))._deleted=!0,[4,this.db.put(e)];case 2:return r=t.sent(),G(n,r),$(n),[2,n]}})})},t.prototype.read=function(t,e){return this._read(this.id.build(t),e)},t.prototype._read=function(i,o){return l(this,void 0,void 0,function(){var e,r,n;return I(this,function(t){switch(t.label){case 0:return r=(e=this.hydrator).hydrate,n=[Object.create(this.entityClass.prototype)],[4,this._readRaw(i)];case 1:return[2,r.apply(e,n.concat([t.sent(),o]))]}})})},t.prototype._readRaw=function(r){return l(this,void 0,void 0,function(){var e;return I(this,function(t){switch(t.label){case 0:return[4,this.queryBatcher.read([r])];case 1:if(!(e=t.sent())[0])throw{status:404,name:"not_found",message:"missing",reason:"missing",id:r};return[2,e[0]]}})})},t.prototype.readAll=function(n,i){return l(this,void 0,void 0,function(){var e,r=this;return I(this,function(t){return e={include_docs:!0},n?e.keys=n.map(function(t){return r.id.build(t)}).sort(function(t,e){return t.localeCompare(e)}):(e.startkey=this.id.head(),e.endkey=this.id.tail()),[2,this._readAll(e,i)]})})},t.prototype._readAll=function(i,o){return l(this,void 0,void 0,function(){var e,r,n=this;return I(this,function(t){switch(t.label){case 0:return r=(e=Promise).all,[4,this._readAllRaw(i)];case 1:return[4,r.apply(e,[t.sent().map(function(e){return l(n,void 0,void 0,function(){return I(this,function(t){return[2,this.hydrator.hydrate(Object.create(this.entityClass.prototype),e,o)]})})})])];case 2:return[2,t.sent()]}})})},t.prototype._readAllRaw=function(e){return l(this,void 0,void 0,function(){return I(this,function(t){switch(t.label){case 0:return e.include_docs&&"keys"in e?[4,this.queryBatcher.read(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[4,this.db.allDocs(e)];case 3:return[2,t.sent().rows.map(function(t){return t.doc}).filter(Boolean)]}})})},t.prototype.query=function(){return new wt(this,this.id.head(),this.id.tail())},t.prototype.executeQuery=function(i,o){return l(this,void 0,void 0,function(){var e,r,n=this;return I(this,function(t){switch(t.label){case 0:return r=(e=Promise).all,[4,this.db.find(i.toFindRequest())];case 1:return[4,r.apply(e,[t.sent().docs.map(function(e){return l(n,void 0,void 0,function(){return I(this,function(t){return[2,this.hydrator.hydrate(Object.create(this.entityClass.prototype),e,o)]})})})])];case 2:return[2,t.sent()]}})})},t.prototype.build=function(t){return void 0===t&&(t={}),y(Object.create(this.entityClass.prototype),t)},t.prototype.persistDesignDoc=function(_){return l(this,void 0,void 0,function(){var n,i,o,a,u,s,c,l,d,f,h,p,y,v,w=this;return I(this,function(t){switch(t.label){case 0:if((u=vt.create(_.constructor)).entity!==this.entityClass)throw new Error("Invalid design doc entity");s={_id:"_design/"+u.name,views:{},filters:{}};try{for(c=E(u.views),l=c.next();!l.done;l=c.next())d=l.value,f=_[d],"string"===(h=typeof f)||"function"===h?s.views[d]={map:f.toString()}:"object"===h&&(s.views[d]={map:f.map.toString(),reduce:f.reduce&&f.reduce.toString()})}catch(e){n={error:e}}finally{try{l&&!l.done&&(i=c["return"])&&i.call(c)}finally{if(n)throw n.error}}try{for(p=E(u.filters),y=p.next();!y.done;y=p.next())v=y.value,s.filters[v]=_[v].toString()}catch(r){o={error:r}}finally{try{y&&!y.done&&(a=p["return"])&&a.call(p)}finally{if(o)throw o.error}}return u.validateDoc&&(s.validate_doc_update=_[u.validateDoc].toString()),[4,this.db.upsert(s._id,function(t){var e=s,r=(e._id,e._rev,m(e,["_id","_rev"])),n=t,i=(n._id,n._rev,m(n,["_id","_rev"]));return!w.equal(r,i)&&s})];case 1:return t.sent(),[2]}})})},t.prototype.view=function(o,a,t){void 0===t&&(t={});var u=t.depth,s=t.circularCache,c=m(t,["depth","circularCache"]);return l(this,void 0,void 0,function(){var e,r,n,i=this;return I(this,function(t){switch(t.label){case 0:if((e=vt.create(o)).entity!==this.entityClass)throw new Error("Invalid design doc entity");if(!e.views.has(a))throw new Error('Unknown view "'+a+'"');return c.include_docs=!0,n=(r=Promise).all,[4,this.rawView(e.name+"/"+a,c)];case 1:return[4,n.apply(r,[t.sent().rows.map(function(t){return t.doc}).map(function(e){return l(i,void 0,void 0,function(){return I(this,function(t){return[2,this.hydrator.hydrate(Object.create(this.entityClass.prototype),e,{depth:u,circularCache:s})]})})})])];case 2:return[2,t.sent()]}})})},t.prototype.rawView=function(t,e){return this.db.query(t,e)},t.prototype.changes=function(e){var n=this;return i.Observable.create(function(r){var t=n.getConnection().changes(e);return t.on("change",function(t){try{n.metadata.name===n.id.parse(t.id).name&&r.next(t)}catch(e){}}),t.on("error",function(t){return r.error(t)}),t.on("complete",function(){return r.complete()}),function(){t.removeAllListeners()}})},t}(),bt={provide:mt,useFactory:function(t,e,r,n,i,o,a,u){return new mt(t,e,r,n,i,o,a,u)},deps:[X,Z,tt,et,nt,at,z,it]},gt=function(r){function t(t){var e=r.call(this)||this;return e.metadata=t,e}return a(t,r),t.prototype.validate=function(s){return l(this,void 0,void 0,function(){var e,r,n,i,o,a,u;return I(this,function(t){switch(t.label){case 0:t.trys.push([0,5,6,7]),n=E(this.metadata.properties),i=n.next(),t.label=1;case 1:return i.done?[3,4]:(o=A(i.value,2),a=o[0],[4,o[1].validate(s[a],a)]);case 2:t.sent(),t.label=3;case 3:return i=n.next(),[3,1];case 4:return[3,7];case 5:return u=t.sent(),e={error:u},[3,7];case 6:try{i&&!i.done&&(r=n["return"])&&r.call(n)}finally{if(e)throw e.error}return[7];case 7:return[2,!0]}})})},t}(it),At=function(){function n(t,e,r,n){this.connectionFactory=t,this.id=e,this.injector=r,this.injectorFactory=n,this.connections=new Map,this.repositories=new Map}return n.prototype.getOpenConnections=function(){return Array.from(this.connections.values())},n.prototype.getConnection=function(t){return this.connections.has(t)||this.connections.set(t,this.createConnection(t)),this.connections.get(t)},n.prototype.clearConnections=function(){this.connections.clear()},n.prototype.createConnection=function(t){return this.connectionFactory(t)},n.prototype.getRepository=function(t){return this.repositories.has(t)||this.repositories.set(t,this.createRepository(t)),this.repositories.get(t)},n.prototype.createRepository=function(t){var e=this,r=this.getMetadata(t);return this.injectorFactory({parent:this.injector,providers:[{provide:n,useValue:this},bt,{provide:Z,useValue:t},{provide:tt,useValue:r},{provide:X,useValue:r.inline?null:this.getConnection(r.name)},{provide:z,useFactory:r.hydrator?r.hydrator:function(){return new lt(e.id,r,e)},deps:[_]},{provide:it,useFactory:r.validator?r.validator:function(){return new gt(r)},deps:[_]},ut]}).get(mt)},n.prototype.getMetadata=function(t){return yt.create(t)},n.prototype.getDesignDocMetadata=function(t){return vt.create(t)},n}();var Ot={provide:At,useFactory:function(t,e,r,n){return new At(t,e,r,n)},deps:[rt,nt,_,b]};t.BelongsTo=function Nt(r){return void 0===r&&(r={}),function(t,e){h(t.constructor,e,y(new k,u({type:Reflect.getMetadata("design:type",t,e),required:!1},r)))}},t.BelongsToMetadata=k,t.DesignDoc=function Rt(e,r){return function(t){f(t,y(new S,{entity:e,name:r}))}},t.DesignDocMetadata=S,t.Entity=function Pt(e,r){return void 0===r&&(r={}),function(t){f(t,y(new q,u({name:e,attachments:!1},r)))}},t.EntityMetadata=q,t.Filter=function kt(){return function(t,e){h(t.constructor,e,y(new F,{}))}},t.FilterMetadata=F,t.HasMany=function St(r,n){return void 0===n&&(n={}),function(t,e){h(t.constructor,e,y(new V,u({type:r,required:!1},n)))}},t.HasManyMetadata=V,t.HasManyMap=function qt(r,n){return void 0===n&&(n={}),function(t,e){h(t.constructor,e,y(new B,u({type:r,required:!1},n)))}},t.HasManyMapMetadata=B,t.Id=function Ft(r){return void 0===r&&(r={}),function(t,e){h(t.constructor,e,y(new U,u({strategy:Y.Static,type:Reflect.getMetadata("design:type",t,e)},r)))}},t.IdStrategy=Y,t.IdMetadata=U,t.Inline=function Vt(r){return void 0===r&&(r={}),function(t,e){h(t.constructor,e,y(new H,u({type:Reflect.getMetadata("design:type",t,e),required:!1},r)))}},t.InlineMetadata=H,t.InlineEntity=function Bt(e){return void 0===e&&(e={}),function(t){f(t,y(new J,u({},e,{inline:!0})))}},t.InlineEntityMetadata=J,t.Property=function Yt(r){return void 0===r&&(r={}),function(t,e){h(t.constructor,e,y(new R,u({type:Reflect.getMetadata("design:type",t,e),required:!1},r)))}},t.PropertyMetadata=R,t.RelationMetadata=P,t.ValidateDoc=function Ut(){return function(t,e){h(t.constructor,e,y(new L,{}))}},t.ValidateDocMetadata=L,t.View=function Ht(){return function(t,e){h(t.constructor,e,y(new Q,{}))}},t.ViewMetadata=Q,t.defer=K,t.markDeleted=$,t.markIdRev=G,t.getClassMetadata=g,t.pushClassMetadata=f,t.getPropertyMetadata=function Jt(t,e,r){return t.hasOwnProperty(d)&&t[d].has(e)?t[d].get(e).filter(function(t){return!r||t instanceof r}):[]},t.getAllPropertyMetadata=O,t.pushPropertyMetadata=h,t.populate=y,t.CLASS_METADATA_KEY=c,t.PROPERTY_METADATA_KEY=d,t.uuid=W,t.BulkOperation=ot,t.Bulk=at,t.ADAMANT_BULK_PROVIDER=ut,t.createAdamantConnection=function Lt(t){return D({providers:[{provide:rt,useValue:t},Ot,{provide:nt,useFactory:ct,deps:[]},{provide:et,useFactory:st,deps:[]}]}).get(At)},t.AdamantConnectionManager=At,t.ADAMANT_CONNECTION_MANAGER_PROVIDER=Ot,t.equalCheckerFactory=st,t.adamantIdFactory=ct,t.Hydrator=z,t.HydratorImpl=lt,t.forwardRef=M,t.resolveForwardRef=T,t.setInjectorFactory=C,t.createInjector=D,t.createAngularInjector=j,t.createInjectionJsInjector=N,t.ADAMANT_INJECTOR=_,t.ADAMANT_INJECTOR_FACTORY=b,t.ADAMANT_CONNECTION=X,t.ADAMANT_ENTITY_CLASS=Z,t.ADAMANT_ENTITY_METADATA=tt,t.ADAMANT_EQUAL_CHECKER=et,t.ADAMANT_CONNECTION_FACTORY=rt,t.ADAMANT_ID=nt,t.throwMissingInjector=w,t.AdamantInjectionToken=v,t.EntityMetadataCollection=yt,t.DesignDocMetadataCollection=vt,t.ReadQueryBatcher=_t,t.QueryBuilder=wt,t.AdamantRepository=mt,t.ADAMANT_REPOSITORY_PROVIDER=bt,t.Validator=it,t.ValidatorImpl=gt,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("reflect-metadata"),require("@angular/core"),require("fast-deep-equal"),require("rxjs")):"function"==typeof define&&define.amd?define("@neoskop/adamant",["exports","reflect-metadata","@angular/core","fast-deep-equal","rxjs"],e):e((t.neoskop=t.neoskop||{},t.neoskop.adamant={}),null,t.ng.core,t.fastDeepEqual,t.rxjs)}(this,function(t,e,r,n,i){"use strict";var o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function a(t,e){function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var u=function(){return(u=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function m(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&(r[n[i]]=t[n[i]])}return r}function l(e,a,u,s){return new(u||(u=Promise))(function(t,r){function n(t){try{o(s.next(t))}catch(e){r(e)}}function i(t){try{o(s["throw"](t))}catch(e){r(e)}}function o(e){e.done?t(e.value):new u(function(t){t(e.value)}).then(n,i)}o((s=s.apply(e,a||[])).next())})}function I(n,i){var o,a,u,t,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return t={next:e(0),"throw":e(1),"return":e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function r(t){if(o)throw new TypeError("Generator is already executing.");for(;s;)try{if(o=1,a&&(u=2&t[0]?a["return"]:t[0]?a["throw"]||((u=a["return"])&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,u&&(t=[2&t[0],u.value]),t[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3])){s.label=t[1];break}if(6===t[0]&&s.label<u[1]){s.label=u[1],u=t;break}if(u&&s.label<u[2]){s.label=u[2],s.ops.push(t);break}u[2]&&s.ops.pop(),s.trys.pop();continue}t=i.call(n,s)}catch(e){t=[6,e],a=0}finally{o=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([e,t])}}}function E(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function A(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),a=[];try{for(;(void 0===e||0<e--)&&!(n=o.next()).done;)a.push(n.value)}catch(u){i={error:u}}finally{try{n&&!n.done&&(r=o["return"])&&r.call(o)}finally{if(i)throw i.error}}return a}function s(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(A(arguments[e]));return t}var c="__adamant_class_metadata",d="__adamant_property_metadata";function g(t,e){return t.hasOwnProperty(c)?t[c].filter(function(t){return!e||t instanceof e}):[]}function f(t,e){t.hasOwnProperty(c)||p(t,c,[]),t[c].push(e)}function O(t){return t.hasOwnProperty(d)?t[d]:new Map}function h(t,e,r){t.hasOwnProperty(d)||p(t,d,new Map),t[d].has(e)||t[d].set(e,[]),t[d].get(e).push(r)}function p(t,e,r){Object.defineProperty(t,e,{value:r})}function y(t,e){var r,n;try{for(var i=E(Object.keys(e)),o=i.next();!o.done;o=i.next()){var a=o.value;t[a]=e[a]}}catch(u){r={error:u}}finally{try{o&&!o.done&&(n=i["return"])&&n.call(i)}finally{if(r)throw r.error}}return t}var v=r.InjectionToken;function w(){throw new Error('Dependency Injection implementation missing, provide "@angular/core" or "injection-js"')}var _=new v("ADAMANT_INJECTOR"),b=new v("ADAMANT_INJECTOR_FACTORY");function M(t){return t.__forward_ref__=M,t}function T(t){return"function"==typeof t&&t.hasOwnProperty("__forward_ref__")&&t.__forward_ref__===M?t():t}var x=null;function C(t){x=t}function D(t){if(x)return x(t);if(!1===x)throw w();try{var e=j(t);return C(j),e}catch(r){try{e=N(t);return C(N),e}catch(n){throw C(!1),w()}}}function j(t){var e=t.providers,r=t.parent,n=require("@angular/core").Injector;return n.create({parent:r,providers:s(e,[{provide:_,useExisting:n},{provide:b,useValue:j}])})}function N(t){var e=t.providers,r=t.parent,n=require("injection-js"),i=n.Injector;return n.ReflectiveInjector.resolveAndCreate(s(e,[{provide:_,useExisting:i},{provide:b,useValue:N}]),r)}var R=function(){function t(){}return t.prototype.validate=function(t,e){if(this.required&&null==t)throw new Error('Property "'+("symbol"==typeof e?Symbol.keyFor(e):e)+'" required')},t}();var P=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return T(this._type)},set:function(t){this._type=t},enumerable:!0,configurable:!0}),e}(R),k=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e}(P);var S=function Mt(){};var q=function Tt(){};var F=function xt(){};var V=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e}(P);var B=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e}(P);var Y={Static:"static",Uuid:"uuid"},U=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),Object.defineProperty(e.prototype,"required",{get:function(){return this.strategy===Y.Static},enumerable:!0,configurable:!0}),e}(R);var H=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e}(P);var J=function Ct(){};var L=function Dt(){};var Q=function jt(){};function K(){var r,n,t=new Promise(function(t,e){r=t,n=e});return Object.assign(t,{resolve:r,reject:n})}function $(t){return Object.defineProperty(t,"_deleted",{configurable:!0,value:!0}),t}function G(t,e){return Object.defineProperty(t,"_id",{configurable:!0,value:e.id}),Object.defineProperty(t,"_rev",{configurable:!0,value:e.rev}),t}function W(){return Array.from(new Array(36),function(t,e){if(8===e||13===e||18===e||23===e)return"-";var r=16*Math.random()|0;return 14==e&&(r=1+(5*Math.random()|0)),19===e&&(r=3&r|8),r.toString(16)}).join("")}var z=function It(){},X=new v("ADAMANT_CONNECTION"),Z=new v("ADAMANT_ENTITY_CLASS"),tt=new v("ADAMANT_ENTITY_METADATA"),et=new v("ADAMANT_EQUAL_CHECKER"),rt=new v("ADAMANT_CONNECTION_FACTORY"),nt=new v("ADAMANT_ID"),it=function Et(){},ot={Create:"create",Update:"update",Delete:"delete"},at=function(){function t(t,e,r,n,i){this.db=t,this.entityClass=e,this.metadata=r,this.hydrator=n,this.validator=i}return t.prototype.bulk=function(o,a){return l(this,void 0,void 0,function(){var e,r,n,i=this;return I(this,function(t){switch(t.label){case 0:return 0===o.length?[2,o]:[4,Promise.all(o.map(function(r){return l(i,void 0,void 0,function(){var e;return I(this,function(t){switch(t.label){case 0:if(!(r instanceof this.entityClass))throw new Error('Entity "'+r+'" is not instanceof '+this.entityClass.name);return[4,this.validator.validate(r)];case 1:return t.sent(),e=this.hydrator.dehydrate(r,{includeRev:a===ot.Update||a===ot.Delete}),a===ot.Delete&&(e._deleted=!0),[2,e]}})})}))];case 1:return e=t.sent(),[4,this.db.bulkDocs(e)];case 2:if(r=t.sent(),0<(n=r.filter(function(t){return Object.prototype.hasOwnProperty.call(t,"error")})).length)throw n;return r.forEach(function(t,e){a===ot.Delete&&$(o[e]),G(o[e],t)}),[2,o]}})})},t.prototype.create=function(t){return this.bulk(t,ot.Create)},t.prototype.update=function(t){return this.bulk(t,ot.Update)},t.prototype["delete"]=function(t){return this.bulk(t,ot.Delete)},t}(),ut={provide:at,useFactory:function(t,e,r,n,i){return new at(t,e,r,n,i)},deps:[X,Z,tt,z,it]};function st(){return n}function ct(){return{head:function(t){return t+"_0"},tail:function(t){return t+"_9"},build:function(t,e,r){if(e===String)return t+"_2_"+r;if(e!==Number)throw new Error('Invalid id type "'+e+'"');var n=r.toString();return t+"_1_"+"0".repeat(16-n.length)+n},parse:function(t){var e=/^(.*)_(1|2)_(.*)$/.exec(t);if(!e)throw new TypeError('Invalid id "'+t+'"');return{name:e[1],type:"2"===e[2]?String:Number,id:"2"===e[2]?e[3]:Number.parseInt(e[3],10)}}}}var lt=function(i){function t(t,e,r){var n=i.call(this)||this;return n.id=t,n.metadata=e,n.connectionManager=r,n}return a(t,i),t.prototype.dehydrate=function(_,t){var e,r,m=this,b={};t&&t.includeRev&&(b._rev=_._rev),this.metadata.attachments&&_._attachments&&(b._attachments=_._attachments);var n=function(t,e){var r,n,i,o,a=_[t];if(e instanceof P)if(null!=a){var u=g.connectionManager.getMetadata(e.type);if(e instanceof V||e instanceof B)try{for(var s=E(u.properties),c=s.next();!c.done;c=s.next()){var l=A(c.value,2),d=l[0],f=l[1];if(f instanceof k&&f.type===g.metadata.entity)try{for(var h=E(e instanceof V?a:Object.values(a)),p=h.next();!p.done;p=h.next()){p.value[d]=_}}catch(v){i={error:v}}finally{try{p&&!p.done&&(o=h["return"])&&o.call(h)}finally{if(i)throw i.error}}}}catch(w){r={error:w}}finally{try{c&&!c.done&&(n=s["return"])&&n.call(s)}finally{if(r)throw r.error}}if(e instanceof k)b[t]=ft(a,u,g.id);else if(e instanceof V)b[t]=a.map(function(t){return ft(t,u,m.id)});else if(e instanceof B){var y={};for(var d in a)y[d]=ft(a[d],u,g.id);b[t]=y}else e instanceof H&&(b[t]=g.connectionManager.getRepository(e.type).hydrator.dehydrate(a))}else null!=e["default"]&&(_[t]=b[t]=e["default"]);else e instanceof R&&(e instanceof U&&(a||e.strategy!==Y.Uuid||(_[t]=a=W()),b._id=g.id.build(g.metadata.name,g.metadata.idType,a)),undefined===a&&undefined!==e["default"]&&(_[t]=a=e["default"]),b[t]=a);undefined===b[t]&&delete b[t]},g=this;try{for(var i=E(this.metadata.properties),o=i.next();!o.done;o=i.next()){var a=A(o.value,2);n(a[0],a[1])}}catch(u){e={error:u}}finally{try{o&&!o.done&&(r=i["return"])&&r.call(i)}finally{if(e)throw e.error}}return b},t.prototype.hydrate=function(x,C,t){var e=void 0===t?{}:t,r=e.depth,D=void 0===r?Infinity:r,n=e.circularCache,j=void 0===n?{}:n;return l(this,void 0,void 0,function(){var e,r,n,T,i,o,a,u,s,c;return I(this,function(t){switch(t.label){case 0:if(C._id in j)return[2,j[C._id]];G(j[C._id]=x,{id:C._id,rev:C._rev}),this.metadata.attachments&&Object.defineProperty(x,"_attachments",{configurable:!0,value:C._attachments}),n=function(n,i){var o,a,u,s,c,l,d,f,h,p,y,v,w,_,m,b,g,A,O,M;return I(this,function(t){switch(t.label){case 0:return null!=(u=C[n])?[3,1]:(x[n]=null!=i["default"]?i["default"]:null,[3,13]);case 1:return i instanceof P?(s=T.connectionManager.getRepository(i.type),i instanceof k?(c=x,l=n,j.hasOwnProperty(u)?(d=j[u],[3,4]):[3,2]):[3,5]):[3,12];case 2:return[4,s._read(u,{depth:D-1,circularCache:j})];case 3:d=t.sent(),t.label=4;case 4:return c[l]=d,[3,11];case 5:return i instanceof V?(f=x,h=n,[4,dt(s,u,D-1,j)]):[3,7];case 6:return f[h]=t.sent(),[3,11];case 7:return i instanceof B?(p=Object.keys(u),y=p.map(function(t){return u[t]}),[4,dt(s,y,D-1,j)]):[3,9];case 8:v=t.sent(),w={},_=function(e){w[e]=v.find(function(t){return t._id===u[e]})};try{for(m=E(p),b=m.next();!b.done;b=m.next())g=b.value,_(g)}catch(e){o={error:e}}finally{try{b&&!b.done&&(a=m["return"])&&a.call(m)}finally{if(o)throw o.error}}return x[n]=w,[3,11];case 9:return i instanceof H?(A=x,O=n,[4,s.hydrator.hydrate(s.build(),u)]):[3,11];case 10:A[O]=t.sent(),t.label=11;case 11:return[3,13];case 12:i instanceof R&&(!(M=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(x),n))||M.writable||M.set)&&(x[n]=function r(t,e){if(e===Date&&t)return new Date(t);return t}(u,i.type)),t.label=13;case 13:return[2]}})},T=this,t.label=1;case 1:t.trys.push([1,6,7,8]),i=E(this.metadata.properties),o=i.next(),t.label=2;case 2:return o.done?[3,5]:(a=A(o.value,2),u=a[0],s=a[1],[5,n(u,s)]);case 3:t.sent(),t.label=4;case 4:return o=i.next(),[3,2];case 5:return[3,8];case 6:return c=t.sent(),e={error:c},[3,8];case 7:try{o&&!o.done&&(r=i["return"])&&r.call(i)}finally{if(e)throw e.error}return[7];case 8:return[2,x]}})})},t}(z);function dt(n,i,o,a){return l(this,void 0,void 0,function(){var e,r;return I(this,function(t){switch(t.label){case 0:return(e=i.filter(function(t){return!a.hasOwnProperty(t)})).length?[4,n._readAll({keys:e,include_docs:!0},{depth:o,circularCache:a})]:[3,2];case 1:r=t.sent(),t.label=2;case 2:return[2,i.map(function(e){return a.hasOwnProperty(e)?a[e]:r&&r.find(function(t){return t._id===e})})]}})})}function ft(t,e,r){return"string"==typeof t?t:r.build(e.name,e.idType,t[e.id])}var ht=new WeakMap,pt=new WeakMap,yt=function(){function e(t){this.entity=t,this.inline=!1,this.properties=new Map,this.parse(),this.assert()}return e.create=function(t){return ht.has(t)||ht.set(t,new e(t)),ht.get(t)},e.prototype.parse=function(){var t,e,r,n,i,o,a=g(this.entity),u=O(this.entity);try{for(var s=E(a),c=s.next();!c.done;c=s.next()){((w=c.value)instanceof q||w instanceof J)&&Object.assign(this,w)}}catch(_){t={error:_}}finally{try{c&&!c.done&&(e=s["return"])&&e.call(s)}finally{if(t)throw t.error}}try{for(var l=E(u),d=l.next();!d.done;d=l.next()){var f=A(d.value,2),h=f[0],p=f[1];try{for(var y=E(p),v=y.next();!v.done;v=y.next()){var w;(w=v.value)instanceof U&&(this.id=h,this.idType=w.type,this.idStrategy=w.strategy),w instanceof R&&this.properties.set(h,w)}}catch(m){i={error:m}}finally{try{v&&!v.done&&(o=y["return"])&&o.call(y)}finally{if(i)throw i.error}}}}catch(b){r={error:b}}finally{try{d&&!d.done&&(n=l["return"])&&n.call(l)}finally{if(r)throw r.error}}},e.prototype.assert=function(){var t,e;try{for(var r=E(this.inline?[]:["id","idStrategy","name","attachments"]),n=r.next();!n.done;n=r.next()){var i=n.value;if(null==this[i])throw new Error("Missing metadata '"+i+"' for entity \""+this.entity.name+'"')}}catch(o){t={error:o}}finally{try{n&&!n.done&&(e=r["return"])&&e.call(r)}finally{if(t)throw t.error}}},e}(),vt=function(){function e(t){this.designDoc=t,this.views=new Set,this.filters=new Set,this.parse(),this.assert()}return e.create=function(t){return pt.has(t)||pt.set(t,new e(t)),pt.get(t)},e.prototype.parse=function(){var t,e,r,n,i,o,a=g(this.designDoc),u=O(this.designDoc);try{for(var s=E(a),c=s.next();!c.done;c=s.next()){(w=c.value)instanceof S&&(Object.assign(this,w),this.name||(this.name=yt.create(this.entity).name))}}catch(_){t={error:_}}finally{try{c&&!c.done&&(e=s["return"])&&e.call(s)}finally{if(t)throw t.error}}try{for(var l=E(u),d=l.next();!d.done;d=l.next()){var f=A(d.value,2),h=f[0],p=f[1];try{for(var y=E(p),v=y.next();!v.done;v=y.next()){var w;(w=v.value)instanceof Q&&this.views.add(h),w instanceof F&&this.filters.add(h),w instanceof L&&(this.validateDoc=h)}}catch(m){i={error:m}}finally{try{v&&!v.done&&(o=y["return"])&&o.call(y)}finally{if(i)throw i.error}}}}catch(b){r={error:b}}finally{try{d&&!d.done&&(n=l["return"])&&n.call(l)}finally{if(r)throw r.error}}},e.prototype.assert=function(){var t,e;try{for(var r=E(["entity"]),n=r.next();!n.done;n=r.next()){var i=n.value;if(null==this[i])throw new Error("Missing metadata '"+i+"' for design doc \""+this.designDoc.name+'"')}}catch(o){t={error:o}}finally{try{n&&!n.done&&(e=r["return"])&&e.call(r)}finally{if(t)throw t.error}}},e}(),wt=function(){function t(t,e,r){this.repository=t,this._selector={},this._sort=[],this._selector._id={$gt:e,$lt:r}}return t.prototype.selector=function(t,e){if("string"==typeof t)"object"!=typeof e&&(e={$eq:e}),t in this._selector?Object.assign(this._selector[t],e):this._selector[t]=e;else for(var r in t)this.selector(r,t[r]);return this},t.prototype.sort=function(t,e){var r;return"string"==typeof t&&e?this._sort.push(((r={})[t]=e,r)):this._sort.push(t),this},t.prototype.limit=function(t){return this._limit=t,this},t.prototype.skip=function(t){return this._skip=t,this},t.prototype.resolve=function(t){return this.repository.executeQuery(this,t)},t.prototype.toFindRequest=function(){var t={selector:this._selector};return 0<this._sort.length&&(t.sort=this._sort),null!=this._limit&&(t.limit=this._limit),null!=this._skip&&(t.skip=this._skip),t},t}(),_t=function(){function t(t){this.db=t,this.queue=[],this.nextTick="undefined"!=typeof process&&process&&process.nextTick instanceof Function?process.nextTick:"undefined"!=typeof setImmediate?setImmediate:setTimeout}return t.prototype.read=function(t){var e;return(e=this.queue).push.apply(e,s(t)),this.schedule().then(function(e){return t.map(function(t){return e.get(t)}).filter(Boolean).map(function(t){return JSON.parse(JSON.stringify(t))})})},t.prototype.schedule=function(){var t=this;return this.deffered||(this.nextTick(function(){t.execute()}),this.deffered=K()),this.deffered},t.prototype.execute=function(){return l(this,void 0,void 0,function(){var e,r,n,i;return I(this,function(t){switch(t.label){case 0:e=this.queue.filter(function(t,e,r){return e===r.indexOf(t)}),this.queue=[],r=this.deffered,delete this.deffered,t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.db.allDocs({include_docs:!0,keys:e})];case 2:return n=t.sent().rows,r.resolve(new Map(n.map(function(t){return t.doc}).filter(Boolean).map(function(t){return[t._id,t]}))),[3,4];case 3:return i=t.sent(),r.reject(i),[3,4];case 4:return[2]}})})},t}(),mt=function(){function t(t,e,r,n,i,o,a,u){var s=this;this.db=t,this.entityClass=e,this.metadata=r,this.equal=n,this.adamantId=i,this.bulk=o,this.hydrator=a,this.validator=u,this.id={head:function(){return s.adamantId.head(s.metadata.name)},tail:function(){return s.adamantId.tail(s.metadata.name)},build:function(t){return s.adamantId.build(s.metadata.name,s.metadata.idType,t)},parse:function(t){return s.adamantId.parse(t)}},this.queryBatcher=new _t(this.db)}return t.prototype.getConnection=function(){return this.db},t.prototype.create=function(n){return l(this,void 0,void 0,function(){var e,r;return I(this,function(t){switch(t.label){case 0:return[4,this.validator.validate(n)];case 1:return t.sent(),e=this.hydrator.dehydrate(n),[4,this.db.put(e)];case 2:return r=t.sent(),G(n,r),[2,n]}})})},t.prototype.upsert=function(n){return l(this,void 0,void 0,function(){var e,r;return I(this,function(t){switch(t.label){case 0:return[4,this.validator.validate(n)];case 1:return t.sent(),e=this.hydrator.dehydrate(n),[4,this._upsert(this.id.build(n[this.metadata.id]),e)];case 2:return r=t.sent(),G(n,r),[2,n]}})})},t.prototype._upsert=function(t,o){var a=this;return this.db.upsert(t,function(t){var e=o,r=(e._id,e._rev,m(e,["_id","_rev"])),n=t,i=(n._id,n._rev,m(n,["_id","_rev"]));return!a.equal(r,i)&&o})},t.prototype.update=function(n){return l(this,void 0,void 0,function(){var e,r;return I(this,function(t){switch(t.label){case 0:return[4,this.validator.validate(n)];case 1:return t.sent(),e=this.hydrator.dehydrate(n,{includeRev:!0}),[4,this.db.put(e)];case 2:return r=t.sent(),G(n,r),[2,n]}})})},t.prototype["delete"]=function(n){return l(this,void 0,void 0,function(){var e,r;return I(this,function(t){switch(t.label){case 0:return[4,this.validator.validate(n)];case 1:return t.sent(),(e=this.hydrator.dehydrate(n,{includeRev:!0}))._deleted=!0,[4,this.db.put(e)];case 2:return r=t.sent(),G(n,r),$(n),[2,n]}})})},t.prototype.read=function(t,e){return this._read(this.id.build(t),e)},t.prototype._read=function(i,o){return l(this,void 0,void 0,function(){var e,r,n;return I(this,function(t){switch(t.label){case 0:return r=(e=this.hydrator).hydrate,n=[Object.create(this.entityClass.prototype)],[4,this._readRaw(i)];case 1:return[2,r.apply(e,n.concat([t.sent(),o]))]}})})},t.prototype._readRaw=function(r){return l(this,void 0,void 0,function(){var e;return I(this,function(t){switch(t.label){case 0:return[4,this.queryBatcher.read([r])];case 1:if(!(e=t.sent())[0])throw{status:404,name:"not_found",message:"missing",reason:"missing",id:r};return[2,e[0]]}})})},t.prototype.readAll=function(n,i){return l(this,void 0,void 0,function(){var e,r=this;return I(this,function(t){return e={include_docs:!0},n?e.keys=n.map(function(t){return r.id.build(t)}).sort(function(t,e){return t.localeCompare(e)}):(e.startkey=this.id.head(),e.endkey=this.id.tail()),[2,this._readAll(e,i)]})})},t.prototype._readAll=function(i,o){return l(this,void 0,void 0,function(){var e,r,n=this;return I(this,function(t){switch(t.label){case 0:return r=(e=Promise).all,[4,this._readAllRaw(i)];case 1:return[4,r.apply(e,[t.sent().map(function(e){return l(n,void 0,void 0,function(){return I(this,function(t){return[2,this.hydrator.hydrate(Object.create(this.entityClass.prototype),e,o)]})})})])];case 2:return[2,t.sent()]}})})},t.prototype._readAllRaw=function(e){return l(this,void 0,void 0,function(){return I(this,function(t){switch(t.label){case 0:return e.include_docs&&"keys"in e?[4,this.queryBatcher.read(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[4,this.db.allDocs(e)];case 3:return[2,t.sent().rows.map(function(t){return t.doc}).filter(Boolean)]}})})},t.prototype.query=function(){return new wt(this,this.id.head(),this.id.tail())},t.prototype.executeQuery=function(i,o){return l(this,void 0,void 0,function(){var e,r,n=this;return I(this,function(t){switch(t.label){case 0:return r=(e=Promise).all,[4,this.db.find(i.toFindRequest())];case 1:return[4,r.apply(e,[t.sent().docs.map(function(e){return l(n,void 0,void 0,function(){return I(this,function(t){return[2,this.hydrator.hydrate(Object.create(this.entityClass.prototype),e,o)]})})})])];case 2:return[2,t.sent()]}})})},t.prototype.build=function(t){return void 0===t&&(t={}),y(Object.create(this.entityClass.prototype),t)},t.prototype.persistDesignDoc=function(_){return l(this,void 0,void 0,function(){var n,i,o,a,u,s,c,l,d,f,h,p,y,v,w=this;return I(this,function(t){switch(t.label){case 0:if((u=vt.create(_.constructor)).entity!==this.entityClass)throw new Error("Invalid design doc entity");s={_id:"_design/"+u.name,views:{},filters:{}};try{for(c=E(u.views),l=c.next();!l.done;l=c.next())d=l.value,f=_[d],"string"===(h=typeof f)||"function"===h?s.views[d]={map:f.toString()}:"object"===h&&(s.views[d]={map:f.map.toString(),reduce:f.reduce&&f.reduce.toString()})}catch(e){n={error:e}}finally{try{l&&!l.done&&(i=c["return"])&&i.call(c)}finally{if(n)throw n.error}}try{for(p=E(u.filters),y=p.next();!y.done;y=p.next())v=y.value,s.filters[v]=_[v].toString()}catch(r){o={error:r}}finally{try{y&&!y.done&&(a=p["return"])&&a.call(p)}finally{if(o)throw o.error}}return u.validateDoc&&(s.validate_doc_update=_[u.validateDoc].toString()),[4,this.db.upsert(s._id,function(t){var e=s,r=(e._id,e._rev,m(e,["_id","_rev"])),n=t,i=(n._id,n._rev,m(n,["_id","_rev"]));return!w.equal(r,i)&&s})];case 1:return t.sent(),[2]}})})},t.prototype.view=function(o,a,t){void 0===t&&(t={});var u=t.depth,s=t.circularCache,c=m(t,["depth","circularCache"]);return l(this,void 0,void 0,function(){var e,r,n,i=this;return I(this,function(t){switch(t.label){case 0:if((e=vt.create(o)).entity!==this.entityClass)throw new Error("Invalid design doc entity");if(!e.views.has(a))throw new Error('Unknown view "'+a+'"');return c.include_docs=!0,n=(r=Promise).all,[4,this.rawView(e.name+"/"+a,c)];case 1:return[4,n.apply(r,[t.sent().rows.map(function(t){return t.doc}).map(function(e){return l(i,void 0,void 0,function(){return I(this,function(t){return[2,this.hydrator.hydrate(Object.create(this.entityClass.prototype),e,{depth:u,circularCache:s})]})})})])];case 2:return[2,t.sent()]}})})},t.prototype.rawView=function(t,e){return this.db.query(t,e)},t.prototype.changes=function(e){var n=this;return i.Observable.create(function(r){var t=n.getConnection().changes(e);return t.on("change",function(t){try{n.metadata.name===n.id.parse(t.id).name&&r.next(t)}catch(e){}}),t.on("error",function(t){return r.error(t)}),t.on("complete",function(){return r.complete()}),function(){t.removeAllListeners()}})},t}(),bt={provide:mt,useFactory:function(t,e,r,n,i,o,a,u){return new mt(t,e,r,n,i,o,a,u)},deps:[X,Z,tt,et,nt,at,z,it]},gt=function(r){function t(t){var e=r.call(this)||this;return e.metadata=t,e}return a(t,r),t.prototype.validate=function(s){return l(this,void 0,void 0,function(){var e,r,n,i,o,a,u;return I(this,function(t){switch(t.label){case 0:t.trys.push([0,5,6,7]),n=E(this.metadata.properties),i=n.next(),t.label=1;case 1:return i.done?[3,4]:(o=A(i.value,2),a=o[0],[4,o[1].validate(s[a],a)]);case 2:t.sent(),t.label=3;case 3:return i=n.next(),[3,1];case 4:return[3,7];case 5:return u=t.sent(),e={error:u},[3,7];case 6:try{i&&!i.done&&(r=n["return"])&&r.call(n)}finally{if(e)throw e.error}return[7];case 7:return[2,!0]}})})},t}(it),At=function(){function n(t,e,r,n){this.connectionFactory=t,this.id=e,this.injector=r,this.injectorFactory=n,this.connections=new Map,this.repositories=new Map}return n.prototype.getOpenConnections=function(){return Array.from(this.connections.values())},n.prototype.getConnection=function(t){return this.connections.has(t)||this.connections.set(t,this.createConnection(t)),this.connections.get(t)},n.prototype.clearConnections=function(){this.connections.clear()},n.prototype.createConnection=function(t){return this.connectionFactory(t)},n.prototype.getRepository=function(t){return this.repositories.has(t)||this.repositories.set(t,this.createRepository(t)),this.repositories.get(t)},n.prototype.createRepository=function(t){var e=this,r=this.getMetadata(t);return this.injectorFactory({parent:this.injector,providers:[{provide:n,useValue:this},bt,{provide:Z,useValue:t},{provide:tt,useValue:r},{provide:X,useValue:r.inline?null:this.getConnection(r.name)},{provide:z,useFactory:r.hydrator?r.hydrator:function(){return new lt(e.id,r,e)},deps:[_]},{provide:it,useFactory:r.validator?r.validator:function(){return new gt(r)},deps:[_]},ut]}).get(mt)},n.prototype.getMetadata=function(t){return yt.create(t)},n.prototype.getDesignDocMetadata=function(t){return vt.create(t)},n}();var Ot={provide:At,useFactory:function(t,e,r,n){return new At(t,e,r,n)},deps:[rt,nt,_,b]};t.BelongsTo=function Nt(r){return void 0===r&&(r={}),function(t,e){h(t.constructor,e,y(new k,u({type:Reflect.getMetadata("design:type",t,e),required:!1},r)))}},t.BelongsToMetadata=k,t.DesignDoc=function Rt(e,r){return function(t){f(t,y(new S,{entity:e,name:r}))}},t.DesignDocMetadata=S,t.Entity=function Pt(e,r){return void 0===r&&(r={}),function(t){f(t,y(new q,u({name:e,attachments:!1},r)))}},t.EntityMetadata=q,t.Filter=function kt(){return function(t,e){h(t.constructor,e,y(new F,{}))}},t.FilterMetadata=F,t.HasMany=function St(r,n){return void 0===n&&(n={}),function(t,e){h(t.constructor,e,y(new V,u({type:r,required:!1},n)))}},t.HasManyMetadata=V,t.HasManyMap=function qt(r,n){return void 0===n&&(n={}),function(t,e){h(t.constructor,e,y(new B,u({type:r,required:!1},n)))}},t.HasManyMapMetadata=B,t.Id=function Ft(r){return void 0===r&&(r={}),function(t,e){h(t.constructor,e,y(new U,u({strategy:Y.Static,type:Reflect.getMetadata("design:type",t,e)},r)))}},t.IdStrategy=Y,t.IdMetadata=U,t.Inline=function Vt(r){return void 0===r&&(r={}),function(t,e){h(t.constructor,e,y(new H,u({type:Reflect.getMetadata("design:type",t,e),required:!1},r)))}},t.InlineMetadata=H,t.InlineEntity=function Bt(e){return void 0===e&&(e={}),function(t){f(t,y(new J,u({},e,{inline:!0})))}},t.InlineEntityMetadata=J,t.Property=function Yt(r){return void 0===r&&(r={}),function(t,e){h(t.constructor,e,y(new R,u({type:Reflect.getMetadata("design:type",t,e),required:!1},r)))}},t.PropertyMetadata=R,t.RelationMetadata=P,t.ValidateDoc=function Ut(){return function(t,e){h(t.constructor,e,y(new L,{}))}},t.ValidateDocMetadata=L,t.View=function Ht(){return function(t,e){h(t.constructor,e,y(new Q,{}))}},t.ViewMetadata=Q,t.defer=K,t.markDeleted=$,t.markIdRev=G,t.getClassMetadata=g,t.pushClassMetadata=f,t.getPropertyMetadata=function Jt(t,e,r){return t.hasOwnProperty(d)&&t[d].has(e)?t[d].get(e).filter(function(t){return!r||t instanceof r}):[]},t.getAllPropertyMetadata=O,t.pushPropertyMetadata=h,t.populate=y,t.CLASS_METADATA_KEY=c,t.PROPERTY_METADATA_KEY=d,t.uuid=W,t.BulkOperation=ot,t.Bulk=at,t.ADAMANT_BULK_PROVIDER=ut,t.createAdamantConnection=function Lt(t){return D({providers:[{provide:rt,useValue:t},Ot,{provide:nt,useFactory:ct,deps:[]},{provide:et,useFactory:st,deps:[]}]}).get(At)},t.AdamantConnectionManager=At,t.ADAMANT_CONNECTION_MANAGER_PROVIDER=Ot,t.equalCheckerFactory=st,t.adamantIdFactory=ct,t.Hydrator=z,t.HydratorImpl=lt,t.forwardRef=M,t.resolveForwardRef=T,t.setInjectorFactory=C,t.createInjector=D,t.createAngularInjector=j,t.createInjectionJsInjector=N,t.ADAMANT_INJECTOR=_,t.ADAMANT_INJECTOR_FACTORY=b,t.ADAMANT_CONNECTION=X,t.ADAMANT_ENTITY_CLASS=Z,t.ADAMANT_ENTITY_METADATA=tt,t.ADAMANT_EQUAL_CHECKER=et,t.ADAMANT_CONNECTION_FACTORY=rt,t.ADAMANT_ID=nt,t.throwMissingInjector=w,t.AdamantInjectionToken=v,t.EntityMetadataCollection=yt,t.DesignDocMetadataCollection=vt,t.ReadQueryBatcher=_t,t.QueryBuilder=wt,t.AdamantRepository=mt,t.ADAMANT_REPOSITORY_PROVIDER=bt,t.Validator=it,t.ValidatorImpl=gt,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=neoskop-adamant.umd.min.js.map

@@ -6,3 +6,3 @@ /**

import * as tslib_1 from "tslib";
import { Observable } from 'rxjs/internal/Observable';
import { Observable } from 'rxjs';
import { Bulk } from './bulk';

@@ -410,2 +410,2 @@ import { Hydrator } from './hydrator';

//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVwb3NpdG9yeS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BuZW9za29wL2FkYW1hbnQvIiwic291cm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JlYWQ8VD4oW2lkXSk7XG4gICAgICAgIGlmICghcmVzdWx0WzBdKSB7XG4gICAgICAgICAgICB0aHJvdyB7XG4gICAgICAgICAgICAgICAgc3RhdHVzOiA0MDQsXG4gICAgICAgICAgICAgICAgbmFtZTogJ25vdF9mb3VuZCcsXG4gICAgICAgICAgICAgICAgbWVzc2FnZTogJ21pc3NpbmcnLFxuICAgICAgICAgICAgICAgIHJlYXNvbjogJ21pc3NpbmcnLFxuICAgICAgICAgICAgICAgIGlkXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHJlc3VsdFswXTtcbiAgICB9XG5cbiAgICBhc3luYyByZWFkQWxsKGlkcz86IChzdHJpbmcgfCBudW1iZXIpW10sIG9wdGlvbnM/OiBIeWRyYXRlT3B0aW9ucyk6IFByb21pc2U8KFQgJiBBZGFtYW50UmV2TWV0YSlbXT4ge1xuICAgICAgICBjb25zdCBvcHQ6IFBvdWNoREIuQ29yZS5BbGxEb2NzV2l0aEtleXNPcHRpb25zICYgUG91Y2hEQi5Db3JlLkFsbERvY3NXaXRoaW5SYW5nZU9wdGlvbnMgPSB7XG4gICAgICAgICAgICBpbmNsdWRlX2RvY3M6IHRydWVcbiAgICAgICAgfSBhcyBhbnk7XG5cbiAgICAgICAgaWYgKGlkcykge1xuICAgICAgICAgICAgb3B0LmtleXMgPSBpZHMubWFwKGlkID0+IHRoaXMuaWQuYnVpbGQoaWQpKS5zb3J0KChhLCBiKSA9PiBhLmxvY2FsZUNvbXBhcmUoYikpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgb3B0LnN0YXJ0a2V5ID0gdGhpcy5pZC5oZWFkKCk7XG4gICAgICAgICAgICBvcHQuZW5ka2V5ID0gdGhpcy5pZC50YWlsKCk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdGhpcy5fcmVhZEFsbChvcHQsIG9wdGlvbnMpO1xuICAgIH1cblxuICAgIC8qKiBAaW50ZXJu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AgIHRocm93IG5ldyBFcnJvcihgSW52YWxpZCBkZXNpZ24gZG9jIGVudGl0eWApO1xuICAgICAgICB9XG5cbiAgICAgICAgbGV0IGRvY3VtZW50OiB7XG4gICAgICAgICAgICBfaWQ6IHN0cmluZztcbiAgICAgICAgICAgIHZpZXdzOiB7IFtrZXk6IHN0cmluZ106IHsgbWFwOiBzdHJpbmc7IHJlZHVjZT86IHN0cmluZyB9IH07XG4gICAgICAgICAgICBmaWx0ZXJzOiB7IFtrZXk6IHN0cmluZ106IHN0cmluZyB9O1xuICAgICAgICAgICAgdmFsaWRhdGVfZG9jX3VwZGF0ZT86IHN0cmluZztcbiAgICAgICAgfSA9IHtcbiAgICAgICAgICAgIF9pZDogYF9kZXNpZ24vJHttZXRhZGF0YS5uYW1lfWAsXG4gICAgICAgICAgICB2aWV3czoge30sXG4gICAgICAgICAgICBmaWx0ZXJzOiB7fVxuICAgICAgICB9O1xuXG4gICAgICAgIGZvciAoY29uc3QgdmlldyBvZiBtZXRhZGF0YS52aWV3cykge1xuICAgICAgICAgICAgY29uc3QgdmFsdWU6IGFueSA9IGRvY1t2aWV3XTtcbiAgICAgICAgICAgIGNvbnN0IHR5cGUgPSB0eXBlb2YgdmFsdWU7XG5cbiAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBlbHNlICovXG4gICAgICAgICAgICBpZiAodHlwZSA9PT0gJ3N0cmluZycgfHwgdHlwZSA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgICAgIGRvY3VtZW50LnZpZXdzW3ZpZXcgYXMgc3RyaW5nXSA9IHtcbiAgICAgICAgICAgICAgICAgICAgbWFwOiB2YWx1ZS50b1N0cmluZygpXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZSA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgICAgICBkb2N1bWVudC52aWV3c1t2aWV3IGFzIHN0cmluZ10gPSB7XG4gICAgICAgICAgICAgICAgICAgIG1hcDogdmFsdWUubWFwLnRvU3RyaW5nKCksXG4gICAgICAgICAgICAgICAgICAgIHJlZHVjZTogdmFsdWUucmVkdWNlICYmIHZhbHVlLnJlZHVjZS50b1N0cmluZygpXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGZvciAoY29uc3QgZmlsdGVyIG9mIG1ldGFkYXRhLmZpbHRlcnMpIHtcbiAgICAgICAgICAgIGRvY3VtZW50LmZpbHRlcnNbZmlsdGVyIGFzIHN0cmluZ10gPSBkb2NbZmlsdGVyXS50b1N0cmluZygpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKG1ldGFkYXRhLnZhbGlkYXRlRG9jKSB7XG4gICAgICAgICAgICBkb2N1bWVudC52YWxpZGF0ZV9kb2NfdXBkYXRlID0gZG9jW21ldGFkYXRhLnZhbGlkYXRlRG9jXS50b1N0cmluZygpO1xuICAgICAgICB9XG5cbiAgICAgICAgYXdhaXQgdGhpcy5kYi51cHNlcnQ8YW55Pihkb2N1bWVudC5faWQsIGV4aXN0aW5nRG9jID0+IHtcbiAgICAgICAgICAgIGNvbnN0IHsgX2lkOiBfMSwgX3JldjogXzIsIC4uLmQxIH0gPSBkb2N1bWVudCBhcyBhbnk7XG4gICAgICAgICAgICBjb25zdCB7IF9pZDogXzMsIF9yZXY6IF80LCAuLi5kMiB9ID0gZXhpc3RpbmdEb2MgYXMgYW55O1xuXG4gICAgICAgICAgICBpZiAodGhpcy5lcXVhbChkMSwgZDIpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gZG9jdW1lbnQ7XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIHZpZXc8RCwgUCBleHRlbmRzIGtleW9mIEQ+KFxuICAgICAgICBkZXNpZ25Eb2M6IEN0b3I8RD4sXG4gICAgICAgIG5hbWU6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ldGFkYXRhLmVudGl0eSAhPT0gdGhpcy5lbnRpdHlDbGFzcykge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBJbnZhbGlkIGRlc2lnbiBkb2MgZW50aXR5YCk7XG4gICAgICAgIH1cblxuICAgICAgICBsZXQgZG9jdW1lbnQ6IHtcbiAgICAgICAgICAgIF9pZDogc3RyaW5nO1xuICAgICAgICAgICAgdmlld3M6IHsgW2tleTogc3RyaW5nXTogeyBtYXA6IHN0cmluZzsgcmVkdWNlPzogc3RyaW5nIH0gfTtcbiAgICAgICAgICAgIGZpbHRlcnM6IHsgW2tleTogc3RyaW5nXTogc3RyaW5nIH07XG4gICAgICAgICAgICB2YWxpZGF0ZV9kb2NfdXBkYXRlPzogc3RyaW5nO1xuICAgICAgICB9ID0ge1xuICAgICAgICAgICAgX2lkOiBgX2Rlc2lnbi8ke21ldGFkYXRhLm5hbWV9YCxcbiAgICAgICAgICAgIHZpZXdzOiB7fSxcbiAgICAgICAgICAgIGZpbHRlcnM6IHt9XG4gICAgICAgIH07XG5cbiAgICAgICAgZm9yIChjb25zdCB2aWV3IG9mIG1ldGFkYXRhLnZpZXdzKSB7XG4gICAgICAgICAgICBjb25zdCB2YWx1ZTogYW55ID0gZG9jW3ZpZXddO1xuICAgICAgICAgICAgY29uc3QgdHlwZSA9IHR5cGVvZiB2YWx1ZTtcblxuICAgICAgICAgICAgLyogaXN0YW5idWwgaWdub3JlIGVsc2UgKi9cbiAgICAgICAgICAgIGlmICh0eXBlID09PSAnc3RyaW5nJyB8fCB0eXBlID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICAgICAgZG9jdW1lbnQudmlld3NbdmlldyBhcyBzdHJpbmddID0ge1xuICAgICAgICAgICAgICAgICAgICBtYXA6IHZhbHVlLnRvU3RyaW5nKClcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlID09PSAnb2JqZWN0Jykge1xuICAgICAgICAgICAgICAgI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URBTUFOVF9JRCxcbiAgICAgICAgQnVsayxcbiAgICAgICAgSHlkcmF0b3IsXG4gICAgICAgIFZhbGlkYXRvclxuICAgIF0gYXMgYW55W11cbn07XG4iXX0=

@@ -6,3 +6,3 @@ /**

import * as tslib_1 from "tslib";
import { Observable } from 'rxjs/internal/Observable';
import { Observable } from 'rxjs';
import { Bulk } from './bulk';

@@ -625,2 +625,2 @@ import { Hydrator } from './hydrator';

//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVwb3NpdG9yeS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BuZW9za29wL2FkYW1hbnQvIiwic291cmNlcyI6WyJyZXBvc2l0b3J5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQ0EsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBQ3RELE9BQU8sRUFBRSxJQUFJLEVBQUUsTUFBTSxRQUFRLENBQUM7QUFDOUIsT0FBTyxFQUFrQixRQUFRLEVBQUUsTUFBTSxZQUFZLENBQUM7QUFDdEQsT0FBTyxFQUNILGtCQUFrQixFQUNsQixvQkFBb0IsRUFDcEIsdUJBQXVCLEVBQ3ZCLHFCQUFxQixFQUNyQixVQUFVLEVBR2IsTUFBTSxtQkFBbUIsQ0FBQztBQUUzQixPQUFPLEVBQUUsMkJBQTJCLEVBQTRCLE1BQU0sWUFBWSxDQUFDO0FBQ25GLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUMvQyxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUN4RCxPQUFPLEVBQUUsV0FBVyxFQUFFLFNBQVMsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN2RCxPQUFPLEVBQVEsUUFBUSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFDbEQsT0FBTyxFQUFFLFNBQ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WwgaWdub3JlIGVsc2UgKi9cbiAgICAgICAgICAgIGlmICh0eXBlID09PSAnc3RyaW5nJyB8fCB0eXBlID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICAgICAgZG9jdW1lbnQudmlld3NbdmlldyBhcyBzdHJpbmddID0ge1xuICAgICAgICAgICAgICAgICAgICBtYXA6IHZhbHVlLnRvU3RyaW5nKClcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlID09PSAnb2JqZWN0Jykge1xuICAgICAgICAgICAgICAgIGRvY3VtZW50LnZpZXdzW3ZpZXcgYXMgc3RyaW5nXSA9IHtcbiAgICAgICAgICAgICAgICAgICAgbWFwOiB2YWx1ZS5tYXAudG9TdHJpbmcoKSxcbiAgICAgICAgICAgICAgICAgICAgcmVkdWNlOiB2YWx1ZS5yZWR1Y2UgJiYgdmFsdWUucmVkdWNlLnRvU3RyaW5nKClcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZm9yIChjb25zdCBmaWx0ZXIgb2YgbWV0YWRhdGEuZmlsdGVycykge1xuICAgICAgICAgICAgZG9jdW1lbnQuZmlsdGVyc1tmaWx0ZXIgYXMgc3RyaW5nXSA9IGRvY1tmaWx0ZXJdLnRvU3RyaW5nKCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAobWV0YWRhdGEudmFsaWRhdGVEb2MpIHtcbiAgICAgICAgICAgIGRvY3VtZW50LnZhbGlkYXRlX2RvY191cGRhdGUgPSBkb2NbbWV0YWRhdGEudmFsaWRhdGVEb2NdLnRvU3RyaW5nKCk7XG4gICAgICAgIH1cblxuICAgICAgICBhd2FpdCB0aGlzLmRiLnVwc2VydDxhbnk+KGRvY3VtZW50Ll9pZCwgZXhpc3RpbmdEb2MgPT4ge1xuICAgICAgICAgICAgY29uc3QgeyBfaWQ6IF8xLCBfcmV2OiBfMiwgLi4uZDEgfSA9IGRvY3Vt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gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLm1ldGFkYXRhLm5hbWUgPT09IHRoaXMuaWQucGFyc2UoY2hhbmdlLmlkKS5uYW1lKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzdWIubmV4dChjaGFuZ2UpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBjYXRjaCB7fVxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGNoYW5nZXMub24oJ2Vycm9yJywgLyogaXN0YW5idWwgaWdub3JlIG5leHQgKi8gZXJyb3IgPT4gc3ViLmVycm9yKGVycm9yKSk7XG5cbiAgICAgICAgICAgIGNoYW5nZXMub24oJ2NvbXBsZXRlJywgKCkgPT4gc3ViLmNvbXBsZXRlKCkpO1xuXG4gICAgICAgICAgICByZXR1cm4gKCkgPT4ge1xuICAgICAgICAgICAgICAgIGNoYW5nZXMucmVtb3ZlQWxsTGlzdGVuZXJzKCk7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9KTtcbiAgICB9XG59XG5cbmV4cG9ydCBjb25zdCBBREFNQU5UX1JFUE9TSVRPUllfUFJPVklERVIgPSB7XG4gICAgcHJvdmlkZTogQWRhbWFudFJlcG9zaXRvcnksXG4gICAgdXNlRmFjdG9yeShcbiAgICAgICAgZGI6IFBvdWNoREIuRGF0YWJhc2U8YW55PixcbiAgICAgICAgZW50aXR5Q2xhc3M6IEN0b3I8YW55PixcbiAgICAgICAgbWV0YWRhdGE6IEVudGl0eU1ldGFkYXRhQ29sbGVjdGlvbjxhbnk+LFxuICAgICAgICBlcXVhbDogRXF1YWxDaGVja2VyLFxuICAgICAgICBpZDogQWRhbWFudElkLFxuICAgICAgICBidWxrOiBCdWxrPGFueT4sXG4gICAgICAgIGh5ZHJhdG9yOiBIeWRyYXRvcjxhbnk+LFxuICAgICAgICB2YWxpZGF0b3I6IFZhbGlkYXRvcjxhbnk+XG4gICAgKSB7XG4gICAgICAgIHJldHVybiBuZXcgQWRh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AgICAgICAgICBjb25zdCB0eXBlID0gdHlwZW9mIHZhbHVlO1xuXG4gICAgICAgICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgZWxzZSAqL1xuICAgICAgICAgICAgaWYgKHR5cGUgPT09ICdzdHJpbmcnIHx8IHR5cGUgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgICAgICBkb2N1bWVudC52aWV3c1t2aWV3IGFzIHN0cmluZ10gPSB7XG4gICAgICAgICAgICAgICAgICAgIG1hcDogdmFsdWUudG9TdHJpbmcoKVxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT09ICdvYmplY3QnKSB7XG4gICAgICAgICAgICAgICAgZG9jdW1lbnQudmlld3NbdmlldyBhcyBzdHJpbmddID0ge1xuICAgICAgICAgICAgICAgICAgICBtYXA6IHZhbHVlLm1hcC50b1N0cmluZygpLFxuICAgICAgICAgICAgICAgICAgICByZWR1Y2U6IHZhbHVlLnJlZHVjZSAmJiB2YWx1ZS5yZWR1Y2UudG9TdHJpbmcoKVxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBmb3IgKGNvbnN0IGZpbHRlciBvZiBtZXRhZGF0YS5maWx0ZXJzKSB7XG4gICAgICAgICAgICBkb2N1bWVudC5maWx0ZXJzW2ZpbHRlciBhcyBzdHJpbmddID0gZG9jW2ZpbHRlcl0udG9TdHJpbmcoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChtZXRhZGF0YS52YWxpZGF0ZURvYykge1xuICAgICAgICAgICAgZG9jdW1lbnQudmFsaWRhdGVfZG9jX3VwZGF0ZSA9IGRvY1ttZXRhZGF0YS52YWxpZGF0ZURvY10udG9TdHJpbmcoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGF3YWl0IHRoaXMuZGIudXBzZXJ0PGFueT4oZG9jdW1lbnQuX2lkLCBleGlzdGluZ0RvYyA9PiB7XG4gICAgICAgICAgICBjb25zdCB7IF9pZDogXzEsIF9yZXY6IF8yLCAuLi5kMSB9ID0gZG9jdW1lbnQgYXMgYW55O1xuICAgICAgICAgICAgY29uc3QgeyBfaWQ6IF8zLCBfcmV2OiBfNCwgLi4uZDIgfSA9IGV4aXN0aW5nRG9jIGFzIGFueTtcblxuICAgICAgICAgICAgaWYgKHRoaXMuZXF1YWwoZDEsIGQyKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIGRvY3VtZW50O1xuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyB2aWV3PEQsIFAgZXh0ZW5kcyBrZXlvZiBEPihcbiAgICAgICAgZGVzaWduRG9jOiBDdG9yPEQ+LFxuICAgICAgICBuYW1lOiBQLFxuICAgICAgICB7IGRlcHRoLCBjaXJjdWxhckNhY2hlLCAuLi5vcHRpb25zIH06IEh5ZHJhdGVPcHRpb25zICYgUG91Y2hEQi5RdWVyeS5PcHRpb25zPFQsIGFueT4gPSB7fVxuICAgICk6IFByb21pc2U8KFQgJiBBZGFtYW50UmV2TWV0YSlbXT4ge1xuICAgICAgICBjb25zdCBtZXRhZGF0YSA9IERlc2lnbkRvY01ldGFkYXRhQ29sbGVjdGlvbi5jcmVhdGUoZGVzaWduRG9jKTtcblxuICAgICAgICBpZiAobWV0YWRhdGEuZW50aXR5ICE9PSB0aGlzLmVudGl0eUNsYXNzKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYEludmFsaWQgZGVzaWduIGRvYyBlbnRpdHlgKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghbWV0YWRhdGEudmlld3MuaGFzKG5hbWUpKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYFVua25vd24gdmlldyBcIiR7bmFtZX1cImApO1xuICAgICAgICB9XG5cbiAgICAgICAgb3B0aW9ucy5pbmNsdWRlX2RvY3M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ICAgIHZhbGlkYXRvcjogVmFsaWRhdG9yPGFueT5cbiAgICApIHtcbiAgICAgICAgcmV0dXJuIG5ldyBBZGFtYW50UmVwb3NpdG9yeShkYiwgZW50aXR5Q2xhc3MsIG1ldGFkYXRhLCBlcXVhbCwgaWQsIGJ1bGssIGh5ZHJhdG9yLCB2YWxpZGF0b3IpO1xuICAgIH0sXG4gICAgZGVwczogW1xuICAgICAgICBBREFNQU5UX0NPTk5FQ1RJT04sXG4gICAgICAgIEFEQU1BTlRfRU5USVRZX0NMQVNTLFxuICAgICAgICBBREFNQU5UX0VOVElUWV9NRVRBREFUQSxcbiAgICAgICAgQURBTUFOVF9FUVVBTF9DSEVDS0VSLFxuICAgICAgICBBREFNQU5UX0lELFxuICAgICAgICBCdWxrLFxuICAgICAgICBIeWRyYXRvcixcbiAgICAgICAgVmFsaWRhdG9yXG4gICAgXSBhcyBhbnlbXVxufTtcbiJdfQ==

@@ -21,3 +21,3 @@ {

},
"version": "0.3.0-rc.5",
"version": "0.3.0-rc.6",
"description": "PouchDB ORM",

@@ -24,0 +24,0 @@ "repository": "git@github.com:neoskop/adamant.git",

@@ -6,3 +6,3 @@ /// <reference types="pouchdb-find" />

/// <reference types="pouchdb-upsert" />
import { Observable } from 'rxjs/internal/Observable';
import { Observable } from 'rxjs';
import { Bulk } from './bulk';

@@ -9,0 +9,0 @@ import { HydrateOptions, Hydrator } from './hydrator';

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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