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

@ngx-pwa/local-storage

Package Overview
Dependencies
Maintainers
1
Versions
126
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ngx-pwa/local-storage - npm Package Compare versions

Comparing version 7.0.0 to 7.1.0-beta.0

2

bundles/ngx-pwa-local-storage.umd.min.js

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs"),require("rxjs/operators"),require("@angular/common")):"function"==typeof define&&define.amd?define("@ngx-pwa/local-storage",["exports","@angular/core","rxjs","rxjs/operators","@angular/common"],t):t((e["ngx-pwa"]=e["ngx-pwa"]||{},e["ngx-pwa"]["local-storage"]={}),e.ng.core,e.rxjs,e.rxjs.operators,e.ng.common)}(this,function(e,t,s,c,r){"use strict";var n=new t.InjectionToken("localStoragePrefix",{providedIn:"root",factory:function(){return""}});var o=function(){function e(e){void 0===e&&(e=null),this.userPrefix=e,this.prefix="",e&&(this.prefix=e+"_")}return e.prototype.getItem=function(e){var t=localStorage.getItem(""+this.prefix+e),r=null;if(null!=t)try{r=JSON.parse(t)}catch(n){return s.throwError(new Error("Invalid data in localStorage."))}return s.of(r)},e.prototype.setItem=function(e,t){return localStorage.setItem(""+this.prefix+e,JSON.stringify(t)),s.of(!0)},e.prototype.removeItem=function(e){return localStorage.removeItem(""+this.prefix+e),s.of(!0)},e.prototype.clear=function(){return localStorage.clear(),s.of(!0)},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:undefined,decorators:[{type:t.Optional},{type:t.Inject,args:[n]}]}]},e.ngInjectableDef=t.defineInjectable({factory:function(){return new e(t.inject(n,8))},token:e,providedIn:"root"}),e}(),i=function(){function e(e){void 0===e&&(e=null),this.prefix=e,this.dbName="ngStorage",this.objectStoreName="localStorage",this.keyPath="key",this.dataPath="value",this.fallback=null,e&&(this.dbName=e+"_"+this.dbName),this.database=new s.ReplaySubject,this.connect(e)}return e.prototype.getItem=function(e){return this.fallback?this.fallback.getItem(e):this.getItemFromTransaction(e)},e.prototype.getItemFromTransaction=function(t,e){var r=this;return(e?s.of(e):this.transaction()).pipe(c.map(function(e){return e.get(t)}),c.mergeMap(function(e){var t=s.fromEvent(e,"success").pipe(c.map(function(e){return e.target.result}),c.map(function(e){return e&&r.dataPath in e?e[r.dataPath]:null}));return s.race(t,r.toErrorObservable(e,"getter")).pipe(c.first())}),c.first())},e.prototype.setItem=function(o,i){var a,u=this;return this.fallback?this.fallback.setItem(o,i):null==i?s.of(!0):this.transaction("readwrite").pipe(c.tap(function(e){a=e}),c.mergeMap(function(){return u.getItemFromTransaction(o,a)}),c.map(function(e){return null==e?"add":"put"}),c.mergeMap(function(e){var t,r,n;switch(e){case"add":n=a.add(((t={})[u.dataPath]=i,t),o);break;case"put":default:n=a.put(((r={})[u.dataPath]=i,r),o)}return s.race(u.toSuccessObservable(n),u.toErrorObservable(n,"setter")).pipe(c.first())}),c.first())},e.prototype.removeItem=function(r){var n=this;return this.fallback?this.fallback.removeItem(r):this.getItem(r).pipe(c.mergeMap(function(e){return null!=e?n.transaction("readwrite").pipe(c.mergeMap(function(e){var t=e["delete"](r);return s.race(n.toSuccessObservable(t),n.toErrorObservable(t,"remover")).pipe(c.first())})):s.of(!0)}),c.first())},e.prototype.clear=function(){var r=this;return this.fallback?this.fallback.clear():this.transaction("readwrite").pipe(c.mergeMap(function(e){var t=e.clear();return s.race(r.toSuccessObservable(t),r.toErrorObservable(t,"clearer")).pipe(c.first())}),c.first())},e.prototype.connect=function(e){var t,r=this;void 0===e&&(e=null);try{t=indexedDB.open(this.dbName)}catch(o){return void this.setFallback(e)}s.fromEvent(t,"upgradeneeded").pipe(c.first()).subscribe(function(e){var t=e.target.result;t.objectStoreNames.contains(r.objectStoreName)||t.createObjectStore(r.objectStoreName)});var n=s.fromEvent(t,"success");s.race(n,this.toErrorObservable(t,"connection")).pipe(c.first()).subscribe(function(e){r.database.next(e.target.result)},function(){r.setFallback(e)})},e.prototype.transaction=function(t){var r=this;return void 0===t&&(t="readonly"),this.database.pipe(c.map(function(e){return e.transaction([r.objectStoreName],t).objectStore(r.objectStoreName)}))},e.prototype.toSuccessObservable=function(e){return s.fromEvent(e,"success").pipe(c.map(function(){return!0}))},e.prototype.toErrorObservable=function(e,t){return void 0===t&&(t=""),s.fromEvent(e,"error").pipe(c.mergeMap(function(){return s.throwError(new Error("IndexedDB "+t+" issue : "+e.error.message+"."))}))},e.prototype.setFallback=function(e){this.fallback=new o(e)},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:undefined,decorators:[{type:t.Optional},{type:t.Inject,args:[n]}]}]},e.ngInjectableDef=t.defineInjectable({factory:function(){return new e(t.inject(n,8))},token:e,providedIn:"root"}),e}(),a=function(){function e(){this.localStorage=new Map}return e.prototype.getItem=function(e){var t=this.localStorage.get(e);return s.of(t!==undefined?t:null)},e.prototype.setItem=function(e,t){return this.localStorage.set(e,t),s.of(!0)},e.prototype.removeItem=function(e){return this.localStorage["delete"](e),s.of(!0)},e.prototype.clear=function(){return this.localStorage.clear(),s.of(!0)},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ngInjectableDef=t.defineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e}();function u(e,t){return r.isPlatformBrowser(e)&&"indexedDB"in window&&indexedDB!==undefined&&null!==indexedDB?new i(t):r.isPlatformBrowser(e)&&"localStorage"in window&&localStorage!==undefined&&null!==localStorage?new o(t):new a}var l=function(){function e(){}return e.decorators=[{type:t.Injectable,args:[{providedIn:"root",useFactory:u,deps:[t.PLATFORM_ID,[new t.Optional,n]]}]}],e.ngInjectableDef=t.defineInjectable({factory:function(){return u(t.inject(t.PLATFORM_ID),t.inject(n,8))},token:e,providedIn:"root"}),e}();function p(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}var f=function(){function e(){}return e.prototype.validate=function(e,t){if(!((t.hasOwnProperty("const")&&t["const"]!==undefined||t.hasOwnProperty("enum")&&null!=t["enum"]||t.hasOwnProperty("type")&&null!=t.type)&&"array"!==t.type&&"object"!==t.type||t.hasOwnProperty("properties")&&null!=t.properties||t.hasOwnProperty("items")&&null!=t.items))throw new Error("Each value must have a 'type' or 'properties' or 'items' or 'const' or 'enum', to enforce strict types.");return(!t.hasOwnProperty("const")||t["const"]===undefined||e===t["const"])&&(!!this.validateEnum(e,t)&&(!!this.validateType(e,t)&&(!!this.validateItems(e,t)&&(!!this.validateProperties(e,t)&&!!this.validateRequired(e,t)))))},e.prototype.isObjectNotNull=function(e){return null!==e&&"object"==typeof e},e.prototype.validateProperties=function(e,t){if(!t.hasOwnProperty("properties")||null==t.properties)return!0;if(!this.isObjectNotNull(e))return!1;if(Object.keys(t.properties).length!==Object.keys(e).length)return!1;for(var r in t.properties)if(t.properties.hasOwnProperty(r)&&e.hasOwnProperty(r)&&!this.validate(e[r],t.properties[r]))return!1;return!0},e.prototype.validateRequired=function(e,t){var r,n;if(!t.hasOwnProperty("required")||null==t.required)return!0;if(!this.isObjectNotNull(e))return!1;try{for(var o=p(t.required),i=o.next();!i.done;i=o.next()){var a=i.value;if(!t.properties||!t.properties.hasOwnProperty(a))throw new Error("'required' properties must be described in 'properties' too.");if(!e.hasOwnProperty(a))return!1}}catch(u){r={error:u}}finally{try{i&&!i.done&&(n=o["return"])&&n.call(o)}finally{if(r)throw r.error}}return!0},e.prototype.validateEnum=function(e,t){return!t.hasOwnProperty("enum")||null==t["enum"]||-1!==t["enum"].indexOf(e)},e.prototype.validateType=function(e,t){if(!t.hasOwnProperty("type")||null==t.type)return!0;switch(t.type){case"null":return null===e;case"string":return this.validateString(e,t);case"number":case"integer":return this.validateNumber(e,t);case"boolean":return"boolean"==typeof e;case"object":return"object"==typeof e;case"array":return Array.isArray(e)}return!0},e.prototype.validateItems=function(e,t){var r,n;if(!t.hasOwnProperty("items")||null==t.items)return!0;if(!Array.isArray(e))return!1;if(t.hasOwnProperty("maxItems")&&null!=t.maxItems){if(!Number.isInteger(t.maxItems)||t.maxItems<0)throw new Error("'maxItems' must be a non-negative integer.");if(e.length>t.maxItems)return!1}if(t.hasOwnProperty("minItems")&&null!=t.minItems){if(!Number.isInteger(t.minItems)||t.minItems<0)throw new Error("'minItems' must be a non-negative integer.");if(e.length<t.minItems)return!1}if(t.hasOwnProperty("uniqueItems")&&null!=t.uniqueItems&&t.uniqueItems){var o=new Set(e);if(e.length!==o.size)return!1}if(Array.isArray(t.items))return this.validateItemsList(e,t);try{for(var i=p(e),a=i.next();!a.done;a=i.next()){var u=a.value;if(!this.validate(u,t.items))return!1}}catch(s){r={error:s}}finally{try{a&&!a.done&&(n=i["return"])&&n.call(i)}finally{if(r)throw r.error}}return!0},e.prototype.validateItemsList=function(e,t){var r=t.items;if(e.length!==r.length)return!1;for(var n=0;n<r.length;n+=1)if(!this.validate(e[n],r[n]))return!1;return!0},e.prototype.validateString=function(e,t){if("string"!=typeof e)return!1;if(t.hasOwnProperty("maxLength")&&null!=t.maxLength){if(!Number.isInteger(t.maxLength)||t.maxLength<0)throw new Error("'maxLength' must be a non-negative integer.");if(e.length>t.maxLength)return!1}if(t.hasOwnProperty("minLength")&&null!=t.minLength){if(!Number.isInteger(t.minLength)||t.minLength<0)throw new Error("'minLength' must be a non-negative integer.");if(e.length<t.minLength)return!1}if(t.hasOwnProperty("pattern")&&null!=t.pattern&&!new RegExp(t.pattern).test(e))return!1;return!0},e.prototype.validateNumber=function(e,t){if("number"!=typeof e)return!1;if("integer"===t.type&&!Number.isInteger(e))return!1;if(t.hasOwnProperty("multipleOf")&&null!=t.multipleOf){if(t.multipleOf<=0)throw new Error("'multipleOf' must be a number strictly greater than 0.");if(!Number.isInteger(e/t.multipleOf))return!1}return!(t.hasOwnProperty("maximum")&&null!=t.maximum&&e>t.maximum)&&(!(t.hasOwnProperty("exclusiveMaximum")&&null!=t.exclusiveMaximum&&e>=t.exclusiveMaximum)&&(!(t.hasOwnProperty("minimum")&&null!=t.minimum&&e<t.minimum)&&!(t.hasOwnProperty("exclusiveMinimum")&&null!=t.exclusiveMinimum&&e<=t.exclusiveMinimum)))},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ngInjectableDef=t.defineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e}(),m=function(){function e(e,t){this.database=e,this.jsonValidator=t,this.getItemOptionsDefault={schema:null}}return e.prototype.getItem=function(e,n){var o=this;return void 0===n&&(n=this.getItemOptionsDefault),this.database.getItem(e).pipe(c.mergeMap(function(e){if(null===e)return s.of(null);if(n.schema){var t=!0;try{t=o.jsonValidator.validate(e,n.schema)}catch(r){return s.throwError(r)}if(!t)return s.throwError(new Error("JSON invalid"))}return s.of(e)}))},e.prototype.getUnsafeItem=function(e){return this.database.getItem(e)},e.prototype.setItem=function(e,t){return this.database.setItem(e,t)},e.prototype.removeItem=function(e){return this.database.removeItem(e)},e.prototype.clear=function(){return this.database.clear()},e.prototype.setItemSubscribe=function(e,t){this.setItem(e,t).subscribe(function(){},function(){})},e.prototype.removeItemSubscribe=function(e){this.removeItem(e).subscribe(function(){},function(){})},e.prototype.clearSubscribe=function(){this.clear().subscribe(function(){},function(){})},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:l},{type:f}]},e.ngInjectableDef=t.defineInjectable({factory:function(){return new e(t.inject(l),t.inject(f))},token:e,providedIn:"root"}),e}();e.LocalDatabase=l,e.IndexedDBDatabase=i,e.LocalStorageDatabase=o,e.MockLocalDatabase=a,e.JSONValidator=f,e.LocalStorage=m,e.localStorageProviders=function d(e){return[e.prefix?{provide:n,useValue:e.prefix}:[]]},e.LOCAL_STORAGE_PREFIX=n,e.ɵa=u,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs"),require("rxjs/operators"),require("@angular/common")):"function"==typeof define&&define.amd?define("@ngx-pwa/local-storage",["exports","@angular/core","rxjs","rxjs/operators","@angular/common"],t):t((e["ngx-pwa"]=e["ngx-pwa"]||{},e["ngx-pwa"]["local-storage"]={}),e.ng.core,e.rxjs,e.rxjs.operators,e.ng.common)}(this,function(e,t,s,c,r){"use strict";var n=new t.InjectionToken("localStoragePrefix",{providedIn:"root",factory:function(){return""}});var o=function(){function e(e){void 0===e&&(e=null),this.userPrefix=e,this.prefix="",e&&(this.prefix=e+"_")}return Object.defineProperty(e.prototype,"size",{get:function(){return s.of(localStorage.length)},enumerable:!0,configurable:!0}),e.prototype.getItem=function(e){var t=localStorage.getItem(""+this.prefix+e),r=null;if(null!=t)try{r=JSON.parse(t)}catch(n){return s.throwError(new Error("Invalid data in localStorage."))}return s.of(r)},e.prototype.setItem=function(e,t){return localStorage.setItem(""+this.prefix+e,JSON.stringify(t)),s.of(!0)},e.prototype.removeItem=function(e){return localStorage.removeItem(""+this.prefix+e),s.of(!0)},e.prototype.clear=function(){return localStorage.clear(),s.of(!0)},e.prototype.keys=function(){for(var e=[],t=0;t<localStorage.length;t+=1){var r=localStorage.key(t);e.push(""===this.prefix?r:r.substr(this.prefix.length))}return 0<e.length?s.from(e):s.EMPTY},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:undefined,decorators:[{type:t.Optional},{type:t.Inject,args:[n]}]}]},e.ngInjectableDef=t.defineInjectable({factory:function(){return new e(t.inject(n,8))},token:e,providedIn:"root"}),e}(),a=function(){function e(e){void 0===e&&(e=null),this.prefix=e,this.dbName="ngStorage",this.objectStoreName="localStorage",this.keyPath="key",this.dataPath="value",this.fallback=null,e&&(this.dbName=e+"_"+this.dbName),this.database=new s.ReplaySubject,this.connect(e)}return Object.defineProperty(e.prototype,"size",{get:function(){var n=this;return this.fallback?this.fallback.size:this.transaction("readonly").pipe(c.mergeMap(function(e){var t=e.count(),r=s.fromEvent(t,"success").pipe(c.map(function(e){return e.target.result}));return s.race(r,n.toErrorObservable(t,"length"))}))},enumerable:!0,configurable:!0}),e.prototype.getItem=function(e){return this.fallback?this.fallback.getItem(e):this.getItemFromTransaction(e)},e.prototype.getItemFromTransaction=function(t,e){var r=this;return(e?s.of(e):this.transaction()).pipe(c.map(function(e){return e.get(t)}),c.mergeMap(function(e){var t=s.fromEvent(e,"success").pipe(c.map(function(e){return e.target.result}),c.map(function(e){return e&&r.dataPath in e?e[r.dataPath]:null}));return s.race(t,r.toErrorObservable(e,"getter"))}))},e.prototype.setItem=function(o,a){var i,u=this;return this.fallback?this.fallback.setItem(o,a):null==a?s.of(!0):this.transaction("readwrite").pipe(c.tap(function(e){i=e}),c.mergeMap(function(){return u.getItemFromTransaction(o,i)}),c.map(function(e){return null==e?"add":"put"}),c.mergeMap(function(e){var t,r,n;switch(e){case"add":n=i.add(((t={})[u.dataPath]=a,t),o);break;case"put":default:n=i.put(((r={})[u.dataPath]=a,r),o)}return s.race(u.toSuccessObservable(n),u.toErrorObservable(n,"setter"))}))},e.prototype.removeItem=function(r){var n=this;return this.fallback?this.fallback.removeItem(r):this.getItem(r).pipe(c.mergeMap(function(e){return null!=e?n.transaction("readwrite").pipe(c.mergeMap(function(e){var t=e["delete"](r);return s.race(n.toSuccessObservable(t),n.toErrorObservable(t,"remover"))})):s.of(!0)}))},e.prototype.clear=function(){var r=this;return this.fallback?this.fallback.clear():this.transaction("readwrite").pipe(c.mergeMap(function(e){var t=e.clear();return s.race(r.toSuccessObservable(t),r.toErrorObservable(t,"clearer"))}))},e.prototype.keys=function(){var n=this;if(this.fallback)return this.fallback.keys();return this.transaction("readonly").pipe(c.mergeMap(function(e){var t=e.getAllKeys(),r=s.fromEvent(t,"success").pipe(c.map(function(e){return e.target.result}),c.mergeMap(function(e){return 0<e.length?s.from(e):s.EMPTY}));return s.race(r,n.toErrorObservable(t,"keys"))}))},e.prototype.connect=function(e){var t,r=this;void 0===e&&(e=null);try{t=indexedDB.open(this.dbName)}catch(o){return void this.setFallback(e)}s.fromEvent(t,"upgradeneeded").pipe(c.first()).subscribe(function(e){var t=e.target.result;t.objectStoreNames.contains(r.objectStoreName)||t.createObjectStore(r.objectStoreName)});var n=s.fromEvent(t,"success");s.race(n,this.toErrorObservable(t,"connection")).pipe(c.first()).subscribe(function(e){r.database.next(e.target.result)},function(){r.setFallback(e)})},e.prototype.transaction=function(t){var r=this;return void 0===t&&(t="readonly"),this.database.pipe(c.map(function(e){return e.transaction([r.objectStoreName],t).objectStore(r.objectStoreName)}))},e.prototype.toSuccessObservable=function(e){return s.fromEvent(e,"success").pipe(c.map(function(){return!0}))},e.prototype.toErrorObservable=function(e,t){return void 0===t&&(t=""),s.fromEvent(e,"error").pipe(c.mergeMap(function(){return s.throwError(new Error("IndexedDB "+t+" issue : "+e.error.message+"."))}),c.take(0))},e.prototype.setFallback=function(e){this.fallback=new o(e)},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:undefined,decorators:[{type:t.Optional},{type:t.Inject,args:[n]}]}]},e.ngInjectableDef=t.defineInjectable({factory:function(){return new e(t.inject(n,8))},token:e,providedIn:"root"}),e}(),i=function(){function e(){this.localStorage=new Map}return Object.defineProperty(e.prototype,"size",{get:function(){return s.of(this.localStorage.size)},enumerable:!0,configurable:!0}),e.prototype.getItem=function(e){var t=this.localStorage.get(e);return s.of(t!==undefined?t:null)},e.prototype.setItem=function(e,t){return this.localStorage.set(e,t),s.of(!0)},e.prototype.removeItem=function(e){return this.localStorage["delete"](e),s.of(!0)},e.prototype.clear=function(){return this.localStorage.clear(),s.of(!0)},e.prototype.keys=function(){return 0<this.localStorage.size?s.from(this.localStorage.keys()):s.EMPTY},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ngInjectableDef=t.defineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e}();function u(e,t){return r.isPlatformBrowser(e)&&"indexedDB"in window&&indexedDB!==undefined&&null!==indexedDB?new a(t):r.isPlatformBrowser(e)&&"localStorage"in window&&localStorage!==undefined&&null!==localStorage?new o(t):new i}var l=function(){function e(){}return e.decorators=[{type:t.Injectable,args:[{providedIn:"root",useFactory:u,deps:[t.PLATFORM_ID,[new t.Optional,n]]}]}],e.ngInjectableDef=t.defineInjectable({factory:function(){return u(t.inject(t.PLATFORM_ID),t.inject(n,8))},token:e,providedIn:"root"}),e}();function p(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}var f=function(){function e(){}return e.prototype.validate=function(e,t){if(!((t.hasOwnProperty("const")&&t["const"]!==undefined||t.hasOwnProperty("enum")&&null!=t["enum"]||t.hasOwnProperty("type")&&null!=t.type)&&"array"!==t.type&&"object"!==t.type||t.hasOwnProperty("properties")&&null!=t.properties||t.hasOwnProperty("items")&&null!=t.items))throw new Error("Each value must have a 'type' or 'properties' or 'items' or 'const' or 'enum', to enforce strict types.");return(!t.hasOwnProperty("const")||t["const"]===undefined||e===t["const"])&&(!!this.validateEnum(e,t)&&(!!this.validateType(e,t)&&(!!this.validateItems(e,t)&&(!!this.validateProperties(e,t)&&!!this.validateRequired(e,t)))))},e.prototype.isObjectNotNull=function(e){return null!==e&&"object"==typeof e},e.prototype.validateProperties=function(e,t){if(!t.hasOwnProperty("properties")||null==t.properties)return!0;if(!this.isObjectNotNull(e))return!1;if(Object.keys(t.properties).length!==Object.keys(e).length)return!1;for(var r in t.properties)if(t.properties.hasOwnProperty(r)&&e.hasOwnProperty(r)&&!this.validate(e[r],t.properties[r]))return!1;return!0},e.prototype.validateRequired=function(e,t){var r,n;if(!t.hasOwnProperty("required")||null==t.required)return!0;if(!this.isObjectNotNull(e))return!1;try{for(var o=p(t.required),a=o.next();!a.done;a=o.next()){var i=a.value;if(!t.properties||!t.properties.hasOwnProperty(i))throw new Error("'required' properties must be described in 'properties' too.");if(!e.hasOwnProperty(i))return!1}}catch(u){r={error:u}}finally{try{a&&!a.done&&(n=o["return"])&&n.call(o)}finally{if(r)throw r.error}}return!0},e.prototype.validateEnum=function(e,t){return!t.hasOwnProperty("enum")||null==t["enum"]||-1!==t["enum"].indexOf(e)},e.prototype.validateType=function(e,t){if(!t.hasOwnProperty("type")||null==t.type)return!0;switch(t.type){case"null":return null===e;case"string":return this.validateString(e,t);case"number":case"integer":return this.validateNumber(e,t);case"boolean":return"boolean"==typeof e;case"object":return"object"==typeof e;case"array":return Array.isArray(e)}return!0},e.prototype.validateItems=function(e,t){var r,n;if(!t.hasOwnProperty("items")||null==t.items)return!0;if(!Array.isArray(e))return!1;if(t.hasOwnProperty("maxItems")&&null!=t.maxItems){if(!Number.isInteger(t.maxItems)||t.maxItems<0)throw new Error("'maxItems' must be a non-negative integer.");if(e.length>t.maxItems)return!1}if(t.hasOwnProperty("minItems")&&null!=t.minItems){if(!Number.isInteger(t.minItems)||t.minItems<0)throw new Error("'minItems' must be a non-negative integer.");if(e.length<t.minItems)return!1}if(t.hasOwnProperty("uniqueItems")&&null!=t.uniqueItems&&t.uniqueItems){var o=new Set(e);if(e.length!==o.size)return!1}if(Array.isArray(t.items))return this.validateItemsList(e,t);try{for(var a=p(e),i=a.next();!i.done;i=a.next()){var u=i.value;if(!this.validate(u,t.items))return!1}}catch(s){r={error:s}}finally{try{i&&!i.done&&(n=a["return"])&&n.call(a)}finally{if(r)throw r.error}}return!0},e.prototype.validateItemsList=function(e,t){var r=t.items;if(e.length!==r.length)return!1;for(var n=0;n<r.length;n+=1)if(!this.validate(e[n],r[n]))return!1;return!0},e.prototype.validateString=function(e,t){if("string"!=typeof e)return!1;if(t.hasOwnProperty("maxLength")&&null!=t.maxLength){if(!Number.isInteger(t.maxLength)||t.maxLength<0)throw new Error("'maxLength' must be a non-negative integer.");if(e.length>t.maxLength)return!1}if(t.hasOwnProperty("minLength")&&null!=t.minLength){if(!Number.isInteger(t.minLength)||t.minLength<0)throw new Error("'minLength' must be a non-negative integer.");if(e.length<t.minLength)return!1}if(t.hasOwnProperty("pattern")&&null!=t.pattern&&!new RegExp(t.pattern).test(e))return!1;return!0},e.prototype.validateNumber=function(e,t){if("number"!=typeof e)return!1;if("integer"===t.type&&!Number.isInteger(e))return!1;if(t.hasOwnProperty("multipleOf")&&null!=t.multipleOf){if(t.multipleOf<=0)throw new Error("'multipleOf' must be a number strictly greater than 0.");if(!Number.isInteger(e/t.multipleOf))return!1}return!(t.hasOwnProperty("maximum")&&null!=t.maximum&&e>t.maximum)&&(!(t.hasOwnProperty("exclusiveMaximum")&&null!=t.exclusiveMaximum&&e>=t.exclusiveMaximum)&&(!(t.hasOwnProperty("minimum")&&null!=t.minimum&&e<t.minimum)&&!(t.hasOwnProperty("exclusiveMinimum")&&null!=t.exclusiveMinimum&&e<=t.exclusiveMinimum)))},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ngInjectableDef=t.defineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e}(),m=function(){function e(e,t){this.database=e,this.jsonValidator=t,this.getItemOptionsDefault={schema:null}}return Object.defineProperty(e.prototype,"size",{get:function(){return this.database.size},enumerable:!0,configurable:!0}),e.prototype.getItem=function(e,n){var o=this;return void 0===n&&(n=this.getItemOptionsDefault),this.database.getItem(e).pipe(c.mergeMap(function(e){if(null===e)return s.of(null);if(n.schema){var t=!0;try{t=o.jsonValidator.validate(e,n.schema)}catch(r){return s.throwError(r)}if(!t)return s.throwError(new Error("JSON invalid"))}return s.of(e)}))},e.prototype.getUnsafeItem=function(e){return this.database.getItem(e)},e.prototype.setItem=function(e,t){return this.database.setItem(e,t)},e.prototype.removeItem=function(e){return this.database.removeItem(e)},e.prototype.clear=function(){return this.database.clear()},e.prototype.keys=function(){return this.database.keys()},e.prototype.setItemSubscribe=function(e,t){this.setItem(e,t).subscribe(function(){},function(){})},e.prototype.removeItemSubscribe=function(e){this.removeItem(e).subscribe(function(){},function(){})},e.prototype.clearSubscribe=function(){this.clear().subscribe(function(){},function(){})},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:l},{type:f}]},e.ngInjectableDef=t.defineInjectable({factory:function(){return new e(t.inject(l),t.inject(f))},token:e,providedIn:"root"}),e}();e.LocalDatabase=l,e.IndexedDBDatabase=a,e.LocalStorageDatabase=o,e.MockLocalDatabase=i,e.JSONValidator=f,e.LocalStorage=m,e.localStorageProviders=function h(e){return[e.prefix?{provide:n,useValue:e.prefix}:[]]},e.LOCAL_STORAGE_PREFIX=n,e.ɵa=u,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=ngx-pwa-local-storage.umd.min.js.map

@@ -6,4 +6,4 @@ /**

import { Injectable, Optional, Inject } from '@angular/core';
import { ReplaySubject, fromEvent, of, throwError, race } from 'rxjs';
import { map, mergeMap, first, tap } from 'rxjs/operators';
import { ReplaySubject, fromEvent, of, throwError, race, from, EMPTY } from 'rxjs';
import { map, mergeMap, first, tap, take } from 'rxjs/operators';
import { LocalStorageDatabase } from './localstorage-database';

@@ -50,2 +50,20 @@ import { LOCAL_STORAGE_PREFIX } from '../tokens';

/**
* @return {?}
*/
get size() {
/* Fallback storage if set */
if (this.fallback) {
return this.fallback.size;
}
return this.transaction('readonly').pipe(mergeMap((transaction) => {
/* Deleting the item in local storage */
/** @type {?} */
const request = transaction.count();
/** @type {?} */
const success = ((/** @type {?} */ (fromEvent(request, 'success')))).pipe(map((event) => (/** @type {?} */ (((/** @type {?} */ (event.target))).result))));
/* Merging success and errors events and autoclosing the observable */
return ((/** @type {?} */ (race(success, this.toErrorObservable(request, `length`)))));
}));
}
/**
* Gets an item value in local storage

@@ -80,5 +98,4 @@ * @template T

/* Merging success and errors events and autoclosing the observable */
return ((/** @type {?} */ (race(success, this.toErrorObservable(request, `getter`)))))
.pipe(first());
}), first());
return (race(success, this.toErrorObservable(request, `getter`)));
}));
}

@@ -124,5 +141,4 @@ /**

/* Merging success (passing true) and error events and autoclosing the observable */
return ((/** @type {?} */ (race(this.toSuccessObservable(request), this.toErrorObservable(request, `setter`)))))
.pipe(first());
}), first());
return (race(this.toSuccessObservable(request), this.toErrorObservable(request, `setter`)));
}));
}

@@ -149,4 +165,3 @@ /**

/* Merging success (passing true) and error events and autoclosing the observable */
return ((/** @type {?} */ (race(this.toSuccessObservable(request), this.toErrorObservable(request, `remover`)))))
.pipe(first());
return (race(this.toSuccessObservable(request), this.toErrorObservable(request, `remover`)));
}));

@@ -156,3 +171,3 @@ }

return of(true);
}), first());
}));
}

@@ -174,7 +189,29 @@ /**

/* Merging success (passing true) and error events and autoclosing the observable */
return ((/** @type {?} */ (race(this.toSuccessObservable(request), this.toErrorObservable(request, `clearer`)))))
.pipe(first());
}), first());
return (race(this.toSuccessObservable(request), this.toErrorObservable(request, `clearer`)));
}));
}
/**
* @return {?}
*/
keys() {
/* Fallback storage if set */
if (this.fallback) {
return this.fallback.keys();
}
/** @type {?} */
let keysSize = 0;
return this.transaction('readonly').pipe(mergeMap((transaction) => {
/* Deleting the item in local storage */
/** @type {?} */
const request = transaction.getAllKeys();
/** @type {?} */
const success = ((/** @type {?} */ (fromEvent(request, 'success')))).pipe(map((event) => (/** @type {?} */ (((/** @type {?} */ (event.target))).result))), mergeMap((keys) => {
keysSize = keys.length;
return (keysSize > 0) ? from(keys) : EMPTY;
}));
/* Merging success and errors events and autoclosing the observable */
return (race(success, this.toErrorObservable(request, `keys`)));
}));
}
/**
* Connects to IndexedDB and creates the object store on first time

@@ -252,3 +289,3 @@ * @param {?=} prefix

return ((/** @type {?} */ (fromEvent(request, 'error'))))
.pipe(mergeMap(() => throwError(new Error(`IndexedDB ${error} issue : ${((/** @type {?} */ (request.error))).message}.`))));
.pipe(mergeMap(() => throwError(new Error(`IndexedDB ${error} issue : ${((/** @type {?} */ (request.error))).message}.`))), take(0));
}

@@ -309,2 +346,2 @@ /**

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXhlZGRiL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EQlJlcXVlc3QsIGVycm9yID0gYGApOiBPYnNlcnZhYmxlPG5ldmVyPiB7XG5cbiAgICAvKiBUcmFuc2Zvcm1pbmcgYSBJbmRleGVkREIgZXJyb3IgZXZlbnQgaW4gYW4gUnhKUyBFcnJvck9ic2VydmFibGUgKi9cbiAgICByZXR1cm4gKGZyb21FdmVudChyZXF1ZXN0LCAnZXJyb3InKSBhcyBPYnNlcnZhYmxlPEV2ZW50PilcbiAgICAgIC5waXBlKFxuICAgICAgICBtZXJnZU1hcCgoKSA9PiB0aHJvd0Vycm9yKG5ldyBFcnJvcihgSW5kZXhlZERCICR7ZXJyb3J9IGlzc3VlIDogJHsocmVxdWVzdC5lcnJvciBhcyBET01FeGNlcHRpb24pLm1lc3NhZ2V9LmApKSksXG4gICAgICAgIHRha2UoMClcbiAgICAgICk7XG5cbiAgfVxuXG4gIHByb3RlY3RlZCBzZXRGYWxsYmFjayhwcmVmaXg6IHN0cmluZyB8IG51bGwpOiB2b2lkIHtcbiAgICB0aGlzLmZhbGxiYWNrID0gbmV3IExvY2FsU3RvcmFnZURhdGFiYXNlKHByZWZpeCk7XG4gIH1cblxufVxuIl19

@@ -49,2 +49,4 @@ /**

if (false) {
/** @type {?} */
LocalDatabase.prototype.size;
/**

@@ -75,3 +77,8 @@ * @abstract

LocalDatabase.prototype.clear = function () { };
/**
* @abstract
* @return {?}
*/
LocalDatabase.prototype.keys = function () { };
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWwtZGF0YWJhc2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Abmd4LXB3YS9sb2NhbC1zdG9yYWdlLyIsInNvdXJjZXMiOlsibGliL2RhdGFiYXNlcy9sb2NhbC1kYXRhYmFzZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxXQUFXLEVBQUUsUUFBUSxFQUFFLE1BQU0sZUFB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2ZXJzYWwpICovXG4gICAgcmV0dXJuIG5ldyBNb2NrTG9jYWxEYXRhYmFzZSgpO1xuXG4gIH1cblxufVxuXG5ASW5qZWN0YWJsZSh7XG4gIHByb3ZpZGVkSW46ICdyb290JyxcbiAgdXNlRmFjdG9yeTogbG9jYWxEYXRhYmFzZUZhY3RvcnksXG4gIGRlcHM6IFtcbiAgICBQTEFURk9STV9JRCxcbiAgICBbbmV3IE9wdGlvbmFsKCksIExPQ0FMX1NUT1JBR0VfUFJFRklYXVxuICBdXG59KVxuZXhwb3J0IGFic3RyYWN0IGNsYXNzIExvY2FsRGF0YWJhc2Uge1xuXG4gIGFic3RyYWN0IHJlYWRvbmx5IHNpemU6IE9ic2VydmFibGU8bnVtYmVyPjtcblxuICBhYnN0cmFjdCBnZXRJdGVtPFQgPSBhbnk+KGtleTogc3RyaW5nKTogT2JzZXJ2YWJsZTxUIHwgbnVsbD47XG4gIGFic3RyYWN0IHNldEl0ZW0oa2V5OiBzdHJpbmcsIGRhdGE6IGFueSk6IE9ic2VydmFibGU8Ym9vbGVhbj47XG4gIGFic3RyYWN0IHJlbW92ZUl0ZW0oa2V5OiBzdHJpbmcpOiBPYnNlcnZhYmxlPGJvb2xlYW4+O1xuICBhYnN0cmFjdCBjbGVhcigpOiBPYnNlcnZhYmxlPGJvb2xlYW4+O1xuICBhYnN0cmFjdCBrZXlzKCk6IE9ic2VydmFibGU8c3RyaW5nPjtcblxufVxuIl19

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

import { Injectable, Optional, Inject } from '@angular/core';
import { of, throwError } from 'rxjs';
import { of, from, throwError, EMPTY } from 'rxjs';
import { LOCAL_STORAGE_PREFIX } from '../tokens';

@@ -24,2 +24,8 @@ import * as i0 from "@angular/core";

/**
* @return {?}
*/
get size() {
return of(localStorage.length);
}
/**
* Gets an item value in local storage

@@ -72,2 +78,15 @@ * @template T

}
/**
* @return {?}
*/
keys() {
/** @type {?} */
const keys = [];
for (let index = 0; index < localStorage.length; index += 1) {
/** @type {?} */
const key = (/** @type {?} */ (localStorage.key(index)));
keys.push((this.prefix === '') ? key : key.substr(this.prefix.length));
}
return (keys.length > 0) ? from(keys) : EMPTY;
}
}

@@ -90,2 +109,2 @@ LocalStorageDatabase.decorators = [

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWxzdG9yYWdlLWRhdGFiYXNlLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQG5neC1wd2EvbG9jYWwtc3RvcmFnZS8iLCJzb3VyY2VzIjpbImxpYi9kYXRhYmFzZXMvbG9jYWxzdG9yYWdlLWRhdGFiYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLFFBQVEsRUFBRSxNQUFNLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDN0QsT0FBTyxFQUFjLEVBQUUsRUFBRSxVQUFVLEVBQUUsTUFBTSxNQUFNLENBQUM7QUFHbEQsT0FBTyxFQUFFLG9CQUFvQixFQUFFLE1BQU0sV0FBVyxDQUFDOzs7QUFLakQsTUFBTSxPQUFPLG9CQUFvQjs7OztJQUsvQixZQUFnRSxhQUE0QixJQUFJO1FBQWhDLGVBQVUsR0FBVixVQUFVLENBQXNCOztRQUZ0RixXQUFNLEdBQUcsRUFBRSxDQUFDO1FBSXBCLElBQUksVUFBVSxFQUFFO1lBQ2QsSUFBSSxDQUFDLE1BQU0sR0FBRyxHQUFHLFVBQVUsR0FBRyxDQUFDO1NBQ2hDO0lBRUgsQ0FBQzs7Ozs7OztJQU9ELE9BQU8sQ0FBVSxHQUFXOztjQUVwQixZQUFZLEdBQUcsWUFBWSxDQUFDLE9BQU8sQ0FBQyxHQUFHLElBQUksQ0FBQyxNQUFNLEdBQUcsR0FBRyxFQUFFLENBQUM7O1lBQzdELFVBQVUsR0FBYSxJQUFJO1FBRS9CLElBQUksWUFBWSxJQUFJLElBQUksRUFBRTtZQUV4QixJQU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luZ1tdID0gW107XG5cbiAgICBmb3IgKGxldCBpbmRleCA9IDA7IGluZGV4IDwgbG9jYWxTdG9yYWdlLmxlbmd0aDsgaW5kZXggKz0gMSkge1xuXG4gICAgICBjb25zdCBrZXkgPSBsb2NhbFN0b3JhZ2Uua2V5KGluZGV4KSBhcyBzdHJpbmc7XG5cbiAgICAgIGtleXMucHVzaCgodGhpcy5wcmVmaXggPT09ICcnKSA/IGtleSA6IGtleS5zdWJzdHIodGhpcy5wcmVmaXgubGVuZ3RoKSk7XG5cbiAgICB9XG5cbiAgICByZXR1cm4gKGtleXMubGVuZ3RoID4gMCkgPyBmcm9tKGtleXMpIDogRU1QVFk7XG5cbiAgfVxuXG59XG4iXX0=

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

import { Injectable } from '@angular/core';
import { of } from 'rxjs';
import { of, from, EMPTY } from 'rxjs';
import * as i0 from "@angular/core";

@@ -14,2 +14,8 @@ export class MockLocalDatabase {

/**
* @return {?}
*/
get size() {
return of(this.localStorage.size);
}
/**
* Gets an item value in local storage

@@ -52,2 +58,8 @@ * @template T

}
/**
* @return {?}
*/
keys() {
return (this.localStorage.size > 0) ? from(this.localStorage.keys()) : EMPTY;
}
}

@@ -64,2 +76,2 @@ MockLocalDatabase.decorators = [

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9jay1sb2NhbC1kYXRhYmFzZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BuZ3gtcHdhL2xvY2FsLXN0b3JhZ2UvIiwic291cmNlcyI6WyJsaWIvZGF0YWJhc2VzL21vY2stbG9jYWwtZGF0YWJhc2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDM0MsT0FBTyxFQUFjLEVBQUUsRUFBRSxNQUFNLE1BQU0sQ0FBQzs7QUFPdEMsTUFBTSxPQUFPLGlCQUFpQjtJQU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2FsU3RvcmFnZS5kZWxldGUoa2V5KTtcblxuICAgIHJldHVybiBvZih0cnVlKTtcblxuICB9XG5cbiAgLyoqXG4gICAqIERlbGV0ZXMgYWxsIGl0ZW1zIGZyb20gbG9jYWwgc3RvcmFnZVxuICAgKiBAcmV0dXJucyBBbiBSeEpTIE9ic2VydmFibGUgdG8gd2FpdCB0aGUgZW5kIG9mIHRoZSBvcGVyYXRpb25cbiAgICovXG4gICBjbGVhcigpOiBPYnNlcnZhYmxlPGJvb2xlYW4+IHtcblxuICAgIHRoaXMubG9jYWxTdG9yYWdlLmNsZWFyKCk7XG5cbiAgICByZXR1cm4gb2YodHJ1ZSk7XG5cbiAgfVxuXG4gIGtleXMoKTogT2JzZXJ2YWJsZTxzdHJpbmc+IHtcblxuICAgIHJldHVybiAodGhpcy5sb2NhbFN0b3JhZ2Uuc2l6ZSA+IDApID8gZnJvbSh0aGlzLmxvY2FsU3RvcmFnZS5rZXlzKCkpIDogRU1QVFk7XG5cbiAgfVxuXG59XG4iXX0=

@@ -34,2 +34,9 @@ /**

/**
* Number of items in the storage
* @return {?}
*/
get size() {
return this.database.size;
}
/**
* @template T

@@ -102,2 +109,9 @@ * @param {?} key

/**
* Get all keys stored in local storage
* @return {?} A RxJS Observable iterating over the indexes
*/
keys() {
return this.database.keys();
}
/**
* Sets an item in local storage, and auto-subscribes

@@ -146,2 +160,2 @@ * @param {?} key The item's key

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGliLnNlcnZpY2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Abmd4LXB3YS9sb2NhbC1zdG9yYWdlLyIsInNvdXJjZXMiOlsibGliL2xpYi5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQzNDLE9BQU8sRUFBYyxVQUFVLEVBQUUsRUFBRS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5kIGF1dG8tc3Vic2NyaWJlcyAqL1xuICBjbGVhclN1YnNjcmliZSgpOiB2b2lkIHtcblxuICAgIHRoaXMuY2xlYXIoKS5zdWJzY3JpYmUoKCkgPT4ge30sICgpID0+IHt9KTtcblxuICB9XG5cbn1cbiJdfQ==

@@ -6,4 +6,4 @@ /**

import { Injectable, Optional, Inject } from '@angular/core';
import { ReplaySubject, fromEvent, of, throwError, race } from 'rxjs';
import { map, mergeMap, first, tap } from 'rxjs/operators';
import { ReplaySubject, fromEvent, of, throwError, race, from, EMPTY } from 'rxjs';
import { map, mergeMap, first, tap, take } from 'rxjs/operators';
import { LocalStorageDatabase } from './localstorage-database';

@@ -49,2 +49,25 @@ import { LOCAL_STORAGE_PREFIX } from '../tokens';

}
Object.defineProperty(IndexedDBDatabase.prototype, "size", {
get: /**
* @return {?}
*/
function () {
var _this = this;
/* Fallback storage if set */
if (this.fallback) {
return this.fallback.size;
}
return this.transaction('readonly').pipe(mergeMap(function (transaction) {
/* Deleting the item in local storage */
/** @type {?} */
var request = transaction.count();
/** @type {?} */
var success = ((/** @type {?} */ (fromEvent(request, 'success')))).pipe(map(function (event) { return (/** @type {?} */ (((/** @type {?} */ (event.target))).result)); }));
/* Merging success and errors events and autoclosing the observable */
return ((/** @type {?} */ (race(success, _this.toErrorObservable(request, "length")))));
}));
},
enumerable: true,
configurable: true
});
/**

@@ -107,5 +130,4 @@ * Gets an item value in local storage

/* Merging success and errors events and autoclosing the observable */
return ((/** @type {?} */ (race(success, _this.toErrorObservable(request, "getter")))))
.pipe(first());
}), first());
return (race(success, _this.toErrorObservable(request, "getter")));
}));
};

@@ -165,5 +187,4 @@ /**

/* Merging success (passing true) and error events and autoclosing the observable */
return ((/** @type {?} */ (race(_this.toSuccessObservable(request), _this.toErrorObservable(request, "setter")))))
.pipe(first());
}), first());
return (race(_this.toSuccessObservable(request), _this.toErrorObservable(request, "setter")));
}));
};

@@ -201,4 +222,3 @@ /**

/* Merging success (passing true) and error events and autoclosing the observable */
return ((/** @type {?} */ (race(_this.toSuccessObservable(request), _this.toErrorObservable(request, "remover")))))
.pipe(first());
return (race(_this.toSuccessObservable(request), _this.toErrorObservable(request, "remover")));
}));

@@ -208,3 +228,3 @@ }

return of(true);
}), first());
}));
};

@@ -235,7 +255,33 @@ /**

/* Merging success (passing true) and error events and autoclosing the observable */
return ((/** @type {?} */ (race(_this.toSuccessObservable(request), _this.toErrorObservable(request, "clearer")))))
.pipe(first());
}), first());
return (race(_this.toSuccessObservable(request), _this.toErrorObservable(request, "clearer")));
}));
};
/**
* @return {?}
*/
IndexedDBDatabase.prototype.keys = /**
* @return {?}
*/
function () {
var _this = this;
/* Fallback storage if set */
if (this.fallback) {
return this.fallback.keys();
}
/** @type {?} */
var keysSize = 0;
return this.transaction('readonly').pipe(mergeMap(function (transaction) {
/* Deleting the item in local storage */
/** @type {?} */
var request = transaction.getAllKeys();
/** @type {?} */
var success = ((/** @type {?} */ (fromEvent(request, 'success')))).pipe(map(function (event) { return (/** @type {?} */ (((/** @type {?} */ (event.target))).result)); }), mergeMap(function (keys) {
keysSize = keys.length;
return (keysSize > 0) ? from(keys) : EMPTY;
}));
/* Merging success and errors events and autoclosing the observable */
return (race(success, _this.toErrorObservable(request, "keys")));
}));
};
/**
* Connects to IndexedDB and creates the object store on first time

@@ -358,3 +404,3 @@ */

return ((/** @type {?} */ (fromEvent(request, 'error'))))
.pipe(mergeMap(function () { return throwError(new Error("IndexedDB " + error + " issue : " + ((/** @type {?} */ (request.error))).message + ".")); }));
.pipe(mergeMap(function () { return throwError(new Error("IndexedDB " + error + " issue : " + ((/** @type {?} */ (request.error))).message + ".")); }), take(0));
};

@@ -421,2 +467,2 @@ /**

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXhlZGRiLWRhdGFiYXNlLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQG5neC1wd2EvbG9jYWwtc3RvcmFnZS8iLCJzb3VyY2VzIjpbImxp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ICAgICAgICBtZXJnZU1hcCgoKSA9PiB0aHJvd0Vycm9yKG5ldyBFcnJvcihgSW5kZXhlZERCICR7ZXJyb3J9IGlzc3VlIDogJHsocmVxdWVzdC5lcnJvciBhcyBET01FeGNlcHRpb24pLm1lc3NhZ2V9LmApKSksXG4gICAgICAgIHRha2UoMClcbiAgICAgICk7XG5cbiAgfVxuXG4gIHByb3RlY3RlZCBzZXRGYWxsYmFjayhwcmVmaXg6IHN0cmluZyB8IG51bGwpOiB2b2lkIHtcbiAgICB0aGlzLmZhbGxiYWNrID0gbmV3IExvY2FsU3RvcmFnZURhdGFiYXNlKHByZWZpeCk7XG4gIH1cblxufVxuIl19

@@ -53,2 +53,4 @@ /**

if (false) {
/** @type {?} */
LocalDatabase.prototype.size;
/**

@@ -79,3 +81,8 @@ * @abstract

LocalDatabase.prototype.clear = function () { };
/**
* @abstract
* @return {?}
*/
LocalDatabase.prototype.keys = function () { };
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWwtZGF0YWJhc2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Abmd4LXB3YS9sb2NhbC1zdG9yYWdlLyIsInNvdXJjZXMiOlsibGliL2RhdGFiYXNlcy9sb2NhbC1kYXRhYmFzZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxXQUFXLEVBQUUsUUFBUSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ2xFLE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBR3BELE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQ3pELE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQy9ELE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBQ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GRlcHM6IFtcbiAgICBQTEFURk9STV9JRCxcbiAgICBbbmV3IE9wdGlvbmFsKCksIExPQ0FMX1NUT1JBR0VfUFJFRklYXVxuICBdXG59KVxuZXhwb3J0IGFic3RyYWN0IGNsYXNzIExvY2FsRGF0YWJhc2Uge1xuXG4gIGFic3RyYWN0IHJlYWRvbmx5IHNpemU6IE9ic2VydmFibGU8bnVtYmVyPjtcblxuICBhYnN0cmFjdCBnZXRJdGVtPFQgPSBhbnk+KGtleTogc3RyaW5nKTogT2JzZXJ2YWJsZTxUIHwgbnVsbD47XG4gIGFic3RyYWN0IHNldEl0ZW0oa2V5OiBzdHJpbmcsIGRhdGE6IGFueSk6IE9ic2VydmFibGU8Ym9vbGVhbj47XG4gIGFic3RyYWN0IHJlbW92ZUl0ZW0oa2V5OiBzdHJpbmcpOiBPYnNlcnZhYmxlPGJvb2xlYW4+O1xuICBhYnN0cmFjdCBjbGVhcigpOiBPYnNlcnZhYmxlPGJvb2xlYW4+O1xuICBhYnN0cmFjdCBrZXlzKCk6IE9ic2VydmFibGU8c3RyaW5nPjtcblxufVxuIl19

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

import { Injectable, Optional, Inject } from '@angular/core';
import { of, throwError } from 'rxjs';
import { of, from, throwError, EMPTY } from 'rxjs';
import { LOCAL_STORAGE_PREFIX } from '../tokens';

@@ -21,2 +21,12 @@ import * as i0 from "@angular/core";

}
Object.defineProperty(LocalStorageDatabase.prototype, "size", {
get: /**
* @return {?}
*/
function () {
return of(localStorage.length);
},
enumerable: true,
configurable: true
});
/**

@@ -111,2 +121,18 @@ * Gets an item value in local storage

};
/**
* @return {?}
*/
LocalStorageDatabase.prototype.keys = /**
* @return {?}
*/
function () {
/** @type {?} */
var keys = [];
for (var index = 0; index < localStorage.length; index += 1) {
/** @type {?} */
var key = (/** @type {?} */ (localStorage.key(index)));
keys.push((this.prefix === '') ? key : key.substr(this.prefix.length));
}
return (keys.length > 0) ? from(keys) : EMPTY;
};
LocalStorageDatabase.decorators = [

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IE9ic2VydmFibGU8Ym9vbGVhbj4ge1xuXG4gICAgbG9jYWxTdG9yYWdlLmNsZWFyKCk7XG5cbiAgICByZXR1cm4gb2YodHJ1ZSk7XG5cbiAgfVxuXG4gIGtleXMoKTogT2JzZXJ2YWJsZTxzdHJpbmc+IHtcblxuICAgIGNvbnN0IGtleXM6IHN0cmluZ1tdID0gW107XG5cbiAgICBmb3IgKGxldCBpbmRleCA9IDA7IGluZGV4IDwgbG9jYWxTdG9yYWdlLmxlbmd0aDsgaW5kZXggKz0gMSkge1xuXG4gICAgICBjb25zdCBrZXkgPSBsb2NhbFN0b3JhZ2Uua2V5KGluZGV4KSBhcyBzdHJpbmc7XG5cbiAgICAgIGtleXMucHVzaCgodGhpcy5wcmVmaXggPT09ICcnKSA/IGtleSA6IGtleS5zdWJzdHIodGhpcy5wcmVmaXgubGVuZ3RoKSk7XG5cbiAgICB9XG5cbiAgICByZXR1cm4gKGtleXMubGVuZ3RoID4gMCkgPyBmcm9tKGtleXMpIDogRU1QVFk7XG5cbiAgfVxuXG59XG4iXX0=

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

import { Injectable } from '@angular/core';
import { of } from 'rxjs';
import { of, from, EMPTY } from 'rxjs';
import * as i0 from "@angular/core";

@@ -13,2 +13,12 @@ var MockLocalDatabase = /** @class */ (function () {

}
Object.defineProperty(MockLocalDatabase.prototype, "size", {
get: /**
* @return {?}
*/
function () {
return of(this.localStorage.size);
},
enumerable: true,
configurable: true
});
/**

@@ -93,2 +103,11 @@ * Gets an item value in local storage

};
/**
* @return {?}
*/
MockLocalDatabase.prototype.keys = /**
* @return {?}
*/
function () {
return (this.localStorage.size > 0) ? from(this.localStorage.keys()) : EMPTY;
};
MockLocalDatabase.decorators = [

@@ -107,2 +126,2 @@ { type: Injectable, args: [{

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9jay1sb2NhbC1kYXRhYmFzZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BuZ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G4gICAgcmV0dXJuICh0aGlzLmxvY2FsU3RvcmFnZS5zaXplID4gMCkgPyBmcm9tKHRoaXMubG9jYWxTdG9yYWdlLmtleXMoKSkgOiBFTVBUWTtcblxuICB9XG5cbn1cbiJdfQ==

@@ -29,2 +29,16 @@ /**

}
Object.defineProperty(LocalStorage.prototype, "size", {
/**
* Number of items in the storage
*/
get: /**
* Number of items in the storage
* @return {?}
*/
function () {
return this.database.size;
},
enumerable: true,
configurable: true
});
/**

@@ -157,2 +171,17 @@ * @template T

/**
* Get all keys stored in local storage
* @returns A RxJS Observable iterating over the indexes
*/
/**
* Get all keys stored in local storage
* @return {?} A RxJS Observable iterating over the indexes
*/
LocalStorage.prototype.keys = /**
* Get all keys stored in local storage
* @return {?} A RxJS Observable iterating over the indexes
*/
function () {
return this.database.keys();
};
/**
* Sets an item in local storage, and auto-subscribes

@@ -228,2 +257,2 @@ * @param key The item's key

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGliLnNlcnZpY2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Abmd4LXB3YS9sb2NhbC1zdG9yYWdlLyIsInNvdXJjZXMiOlsibGliL2xpYi5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQzNDLE9BQU8sRUFBYyxVQUFVLEVBQUUsRUFBRSxFQUFFLE1BQU0sTUFBTSxDQUFDO0FBQ2xELE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUUxQyxPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0sNEJBQTRCLENBQUM7QUFFM0QsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLDZCQUE2QixDQUFDOzs7Ozs7O0FBRTVELHNDQUVDOzs7SUFEQyxrQ0FBMkI7O0FBRzdCO0lBU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1zdWJzY3JpYmVzXG4gICAqIEBwYXJhbSBrZXkgVGhlIGl0ZW0ncyBrZXlcbiAgICovXG4gICByZW1vdmVJdGVtU3Vic2NyaWJlKGtleTogc3RyaW5nKTogdm9pZCB7XG5cbiAgICB0aGlzLnJlbW92ZUl0ZW0oa2V5KS5zdWJzY3JpYmUoKCkgPT4ge30sICgpID0+IHt9KTtcblxuICB9XG5cbiAgLyoqIERlbGV0ZXMgYWxsIGl0ZW1zIGZyb20gbG9jYWwgc3RvcmFnZSwgYW5kIGF1dG8tc3Vic2NyaWJlcyAqL1xuICBjbGVhclN1YnNjcmliZSgpOiB2b2lkIHtcblxuICAgIHRoaXMuY2xlYXIoKS5zdWJzY3JpYmUoKCkgPT4ge30sICgpID0+IHt9KTtcblxuICB9XG5cbn1cbiJdfQ==

@@ -31,2 +31,3 @@ import { Observable, ReplaySubject } from 'rxjs';

protected fallback: LocalDatabase | null;
readonly size: Observable<number>;
/**

@@ -68,2 +69,3 @@ * Connects to IndexedDB

clear(): Observable<boolean>;
keys(): Observable<string>;
/**

@@ -70,0 +72,0 @@ * Connects to IndexedDB and creates the object store on first time

@@ -7,2 +7,3 @@ import { Observable } from 'rxjs';

export declare abstract class LocalDatabase {
abstract readonly size: Observable<number>;
abstract getItem<T = any>(key: string): Observable<T | null>;

@@ -12,2 +13,3 @@ abstract setItem(key: string, data: any): Observable<boolean>;

abstract clear(): Observable<boolean>;
abstract keys(): Observable<string>;
}

@@ -6,2 +6,3 @@ import { Observable } from 'rxjs';

protected prefix: string;
readonly size: Observable<number>;
constructor(userPrefix?: string | null);

@@ -32,2 +33,3 @@ /**

clear(): Observable<boolean>;
keys(): Observable<string>;
}

@@ -5,2 +5,3 @@ import { Observable } from 'rxjs';

protected localStorage: Map<string, any>;
readonly size: Observable<number>;
/**

@@ -30,2 +31,3 @@ * Gets an item value in local storage

clear(): Observable<boolean>;
keys(): Observable<string>;
}

@@ -11,2 +11,6 @@ import { Observable } from 'rxjs';

protected jsonValidator: JSONValidator;
/**
* Number of items in the storage
*/
readonly size: Observable<number>;
protected readonly getItemOptionsDefault: LSGetItemOptions;

@@ -53,2 +57,7 @@ constructor(database: LocalDatabase, jsonValidator: JSONValidator);

/**
* Get all keys stored in local storage
* @returns A RxJS Observable iterating over the indexes
*/
keys(): Observable<string>;
/**
* Sets an item in local storage, and auto-subscribes

@@ -55,0 +64,0 @@ * @param key The item's key

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

{"__symbolic":"module","version":4,"metadata":{"JSONSchema":{"__symbolic":"interface"},"JSONSchemaConst":{"__symbolic":"interface"},"JSONSchemaEnum":{"__symbolic":"interface"},"JSONSchemaBoolean":{"__symbolic":"interface"},"JSONSchemaNumeric":{"__symbolic":"interface"},"JSONSchemaString":{"__symbolic":"interface"},"JSONSchemaArray":{"__symbolic":"interface"},"JSONSchemaObject":{"__symbolic":"interface"},"ɵa":{"__symbolic":"function"},"LocalDatabase":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":30,"character":1},"arguments":[{"providedIn":"root","useFactory":{"__symbolic":"reference","name":"ɵa"},"deps":[{"__symbolic":"reference","module":"@angular/core","name":"PLATFORM_ID","line":34,"character":4},[{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":35,"character":9}},{"__symbolic":"reference","name":"LOCAL_STORAGE_PREFIX"}]]}]}],"members":{"getItem":[{"__symbolic":"method"}],"setItem":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"clear":[{"__symbolic":"method"}]},"statics":{"ngInjectableDef":{}}},"IndexedDBDatabase":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":8,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":43,"character":15}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":43,"character":27},"arguments":[{"__symbolic":"reference","name":"LOCAL_STORAGE_PREFIX"}]}]],"parameters":[{"__symbolic":"reference","name":"string"}]}],"getItem":[{"__symbolic":"method"}],"getItemFromTransaction":[{"__symbolic":"method"}],"setItem":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"clear":[{"__symbolic":"method"}],"connect":[{"__symbolic":"method"}],"transaction":[{"__symbolic":"method"}],"toSuccessObservable":[{"__symbolic":"method"}],"toErrorObservable":[{"__symbolic":"method"}],"setFallback":[{"__symbolic":"method"}]},"statics":{"ngInjectableDef":{}}},"LocalStorageDatabase":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":6,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":14,"character":15}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":14,"character":27},"arguments":[{"__symbolic":"reference","name":"LOCAL_STORAGE_PREFIX"}]}]],"parameters":[{"__symbolic":"reference","name":"string"}]}],"getItem":[{"__symbolic":"method"}],"setItem":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"clear":[{"__symbolic":"method"}]},"statics":{"ngInjectableDef":{}}},"MockLocalDatabase":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":5,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"getItem":[{"__symbolic":"method"}],"setItem":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"clear":[{"__symbolic":"method"}]},"statics":{"ngInjectableDef":{}}},"JSONValidator":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":6,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"validate":[{"__symbolic":"method"}],"isObjectNotNull":[{"__symbolic":"method"}],"validateProperties":[{"__symbolic":"method"}],"validateRequired":[{"__symbolic":"method"}],"validateEnum":[{"__symbolic":"method"}],"validateType":[{"__symbolic":"method"}],"validateItems":[{"__symbolic":"method"}],"validateItemsList":[{"__symbolic":"method"}],"validateString":[{"__symbolic":"method"}],"validateNumber":[{"__symbolic":"method"}]},"statics":{"ngInjectableDef":{}}},"LSGetItemOptions":{"__symbolic":"interface"},"LocalStorage":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":12,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"LocalDatabase"},{"__symbolic":"reference","name":"JSONValidator"}]}],"getItem":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"getUnsafeItem":[{"__symbolic":"method"}],"setItem":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"clear":[{"__symbolic":"method"}],"setItemSubscribe":[{"__symbolic":"method"}],"removeItemSubscribe":[{"__symbolic":"method"}],"clearSubscribe":[{"__symbolic":"method"}]},"statics":{"ngInjectableDef":{}}},"localStorageProviders":{"__symbolic":"function","parameters":["config"],"value":[{"__symbolic":"if","condition":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"prefix"},"thenExpression":{"provide":{"__symbolic":"reference","name":"LOCAL_STORAGE_PREFIX"},"useValue":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"prefix"}},"elseExpression":[]}]},"LocalStorageProvidersConfig":{"__symbolic":"interface"},"LOCAL_STORAGE_PREFIX":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":2,"character":40},"arguments":["localStoragePrefix",{"__symbolic":"error","message":"Lambda not supported","line":2,"character":116,"module":"./lib/tokens"}]}},"origins":{"JSONSchema":"./lib/validation/json-schema","JSONSchemaConst":"./lib/validation/json-schema","JSONSchemaEnum":"./lib/validation/json-schema","JSONSchemaBoolean":"./lib/validation/json-schema","JSONSchemaNumeric":"./lib/validation/json-schema","JSONSchemaString":"./lib/validation/json-schema","JSONSchemaArray":"./lib/validation/json-schema","JSONSchemaObject":"./lib/validation/json-schema","ɵa":"./lib/databases/local-database","LocalDatabase":"./lib/databases/local-database","IndexedDBDatabase":"./lib/databases/indexeddb-database","LocalStorageDatabase":"./lib/databases/localstorage-database","MockLocalDatabase":"./lib/databases/mock-local-database","JSONValidator":"./lib/validation/json-validator","LSGetItemOptions":"./lib/lib.service","LocalStorage":"./lib/lib.service","localStorageProviders":"./lib/tokens","LocalStorageProvidersConfig":"./lib/tokens","LOCAL_STORAGE_PREFIX":"./lib/tokens"},"importAs":"@ngx-pwa/local-storage"}
{"__symbolic":"module","version":4,"metadata":{"JSONSchema":{"__symbolic":"interface"},"JSONSchemaConst":{"__symbolic":"interface"},"JSONSchemaEnum":{"__symbolic":"interface"},"JSONSchemaBoolean":{"__symbolic":"interface"},"JSONSchemaNumeric":{"__symbolic":"interface"},"JSONSchemaString":{"__symbolic":"interface"},"JSONSchemaArray":{"__symbolic":"interface"},"JSONSchemaObject":{"__symbolic":"interface"},"ɵa":{"__symbolic":"function"},"LocalDatabase":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":30,"character":1},"arguments":[{"providedIn":"root","useFactory":{"__symbolic":"reference","name":"ɵa"},"deps":[{"__symbolic":"reference","module":"@angular/core","name":"PLATFORM_ID","line":34,"character":4},[{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":35,"character":9}},{"__symbolic":"reference","name":"LOCAL_STORAGE_PREFIX"}]]}]}],"members":{"getItem":[{"__symbolic":"method"}],"setItem":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"clear":[{"__symbolic":"method"}],"keys":[{"__symbolic":"method"}]},"statics":{"ngInjectableDef":{}}},"IndexedDBDatabase":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":8,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":68,"character":15}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":68,"character":27},"arguments":[{"__symbolic":"reference","name":"LOCAL_STORAGE_PREFIX"}]}]],"parameters":[{"__symbolic":"reference","name":"string"}]}],"getItem":[{"__symbolic":"method"}],"getItemFromTransaction":[{"__symbolic":"method"}],"setItem":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"clear":[{"__symbolic":"method"}],"keys":[{"__symbolic":"method"}],"connect":[{"__symbolic":"method"}],"transaction":[{"__symbolic":"method"}],"toSuccessObservable":[{"__symbolic":"method"}],"toErrorObservable":[{"__symbolic":"method"}],"setFallback":[{"__symbolic":"method"}]},"statics":{"ngInjectableDef":{}}},"LocalStorageDatabase":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":6,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":18,"character":15}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":18,"character":27},"arguments":[{"__symbolic":"reference","name":"LOCAL_STORAGE_PREFIX"}]}]],"parameters":[{"__symbolic":"reference","name":"string"}]}],"getItem":[{"__symbolic":"method"}],"setItem":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"clear":[{"__symbolic":"method"}],"keys":[{"__symbolic":"method"}]},"statics":{"ngInjectableDef":{}}},"MockLocalDatabase":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":5,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"getItem":[{"__symbolic":"method"}],"setItem":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"clear":[{"__symbolic":"method"}],"keys":[{"__symbolic":"method"}]},"statics":{"ngInjectableDef":{}}},"JSONValidator":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":6,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"validate":[{"__symbolic":"method"}],"isObjectNotNull":[{"__symbolic":"method"}],"validateProperties":[{"__symbolic":"method"}],"validateRequired":[{"__symbolic":"method"}],"validateEnum":[{"__symbolic":"method"}],"validateType":[{"__symbolic":"method"}],"validateItems":[{"__symbolic":"method"}],"validateItemsList":[{"__symbolic":"method"}],"validateString":[{"__symbolic":"method"}],"validateNumber":[{"__symbolic":"method"}]},"statics":{"ngInjectableDef":{}}},"LSGetItemOptions":{"__symbolic":"interface"},"LocalStorage":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":12,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"LocalDatabase"},{"__symbolic":"reference","name":"JSONValidator"}]}],"getItem":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"getUnsafeItem":[{"__symbolic":"method"}],"setItem":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"clear":[{"__symbolic":"method"}],"keys":[{"__symbolic":"method"}],"setItemSubscribe":[{"__symbolic":"method"}],"removeItemSubscribe":[{"__symbolic":"method"}],"clearSubscribe":[{"__symbolic":"method"}]},"statics":{"ngInjectableDef":{}}},"localStorageProviders":{"__symbolic":"function","parameters":["config"],"value":[{"__symbolic":"if","condition":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"prefix"},"thenExpression":{"provide":{"__symbolic":"reference","name":"LOCAL_STORAGE_PREFIX"},"useValue":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"prefix"}},"elseExpression":[]}]},"LocalStorageProvidersConfig":{"__symbolic":"interface"},"LOCAL_STORAGE_PREFIX":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":2,"character":40},"arguments":["localStoragePrefix",{"__symbolic":"error","message":"Lambda not supported","line":2,"character":116,"module":"./lib/tokens"}]}},"origins":{"JSONSchema":"./lib/validation/json-schema","JSONSchemaConst":"./lib/validation/json-schema","JSONSchemaEnum":"./lib/validation/json-schema","JSONSchemaBoolean":"./lib/validation/json-schema","JSONSchemaNumeric":"./lib/validation/json-schema","JSONSchemaString":"./lib/validation/json-schema","JSONSchemaArray":"./lib/validation/json-schema","JSONSchemaObject":"./lib/validation/json-schema","ɵa":"./lib/databases/local-database","LocalDatabase":"./lib/databases/local-database","IndexedDBDatabase":"./lib/databases/indexeddb-database","LocalStorageDatabase":"./lib/databases/localstorage-database","MockLocalDatabase":"./lib/databases/mock-local-database","JSONValidator":"./lib/validation/json-validator","LSGetItemOptions":"./lib/lib.service","LocalStorage":"./lib/lib.service","localStorageProviders":"./lib/tokens","LocalStorageProvidersConfig":"./lib/tokens","LOCAL_STORAGE_PREFIX":"./lib/tokens"},"importAs":"@ngx-pwa/local-storage"}
{
"name": "@ngx-pwa/local-storage",
"version": "7.0.0",
"version": "7.1.0-beta.0",
"description": "Efficient local storage module for Angular apps and PWA: simple API based on native localStorage API, but internally stored via the asynchronous IndexedDB API for performance, and wrapped in RxJS observables to be homogeneous with other Angular modules.",

@@ -32,4 +32,4 @@ "author": "Cyrille Tuzi",

"peerDependencies": {
"@angular/common": "^7.0.0 || ^7.0.0-rc.0",
"@angular/core": "^7.0.0 || ^7.0.0-rc.0",
"@angular/common": "^7.0.0",
"@angular/core": "^7.0.0",
"rxjs": "^6.0.0"

@@ -36,0 +36,0 @@ },

@@ -162,2 +162,10 @@ # Async local storage for Angular

### Advanced operations
Starting *with version >= 7.1*, in addition to the classic `localStorage`-like API,
this lib also provides `Map`-like methods for advanced operations:
- `.keys()`
See the [documentation](./docs/ADVANCED_OPERATIONS.md) for some recipes.
### Prefix

@@ -164,0 +172,0 @@

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is 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