@ngx-pwa/local-storage
Advanced tools
Comparing version 8.0.0-beta.5 to 8.0.0-beta.6
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common"),require("rxjs"),require("rxjs/operators"),require("@angular/core")):"function"==typeof define&&define.amd?define("@ngx-pwa/local-storage",["exports","@angular/common","rxjs","rxjs/operators","@angular/core"],t):t((e["ngx-pwa"]=e["ngx-pwa"]||{},e["ngx-pwa"]["local-storage"]={}),e.ng.common,e.rxjs,e.rxjs.operators,e.ng.core)}(this,function(e,i,s,c,t){"use strict";var r=new t.InjectionToken("localStoragePrefix",{providedIn:"root",factory:function(){return""}}),n=new t.InjectionToken("localStoragePrefix",{providedIn:"root",factory:function(){return""}}),o="ngStorage",a=new t.InjectionToken("localStorageIDBDBName",{providedIn:"root",factory:function(){return o}}),u="storage",f="localStorage",p=new t.InjectionToken("localStorageIDBStoreName",{providedIn:"root",factory:function(){return null}});var l=function(e,t){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function d(e,t){function r(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function y(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 m="indexedDB is not working",h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.message=m,e}return d(e,t),e}(Error),v="Data stored is not valid against the provided JSON schema.\nCheck your JSON schema, otherwise it means data has been corrupted.",g=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.message=v,e}return d(e,t),e}(Error),b=function(){function e(e,t,r){void 0===e&&(e=o),void 0===t&&(t=null),void 0===r&&(r=""),this.storeName=null,this.dataPath="value",this.isStorePriorToV8=!1,this.dbName=r?r+"_"+e:e,this.storeName=t,this.database=new s.ReplaySubject(1),this.connect()}return Object.defineProperty(e.prototype,"size",{get:function(){var r=this;return this.transaction("readonly").pipe(c.mergeMap(function(e){var t=e.count();return r.requestEventsAndMapTo(t,function(){return t.result})}),c.first())},enumerable:!0,configurable:!0}),e.prototype.getItem=function(r){var n=this;return this.transaction("readonly").pipe(c.mergeMap(function(e){var t=e.get(r);return n.requestEventsAndMapTo(t,function(){if(t.result!==undefined&&null!==t.result){if(!n.isStorePriorToV8)return t.result;if(t.result[n.dataPath]!==undefined&&null!==t.result[n.dataPath])return t.result[n.dataPath]}return null})}),c.first())},e.prototype.setItem=function(i,a){var u=this;return a===undefined||null===a?s.of(!0):this.transaction("readwrite").pipe(c.mergeMap(function(o){var e=u.getKeyRequest(o,i);return u.requestEventsAndMapTo(e,function(){return e.result}).pipe(c.mergeMap(function(e){var t,r=u.isStorePriorToV8?((t={})[u.dataPath]=a,t):a,n=e===undefined?o.add(r,i):o.put(r,i);return u.requestEventsAndMapTo(n,function(){return!0})}))}),c.first())},e.prototype.removeItem=function(r){var n=this;return this.transaction("readwrite").pipe(c.mergeMap(function(e){var t=e["delete"](r);return n.requestEventsAndMapTo(t,function(){return!0})}),c.first())},e.prototype.clear=function(){var r=this;return this.transaction("readwrite").pipe(c.mergeMap(function(e){var t=e.clear();return r.requestEventsAndMapTo(t,function(){return!0})}),c.first())},e.prototype.keys=function(){var i=this;return this.transaction("readonly").pipe(c.mergeMap(function(e){if("getAllKeys"in e){var t=e.getAllKeys();return i.requestEventsAndMapTo(t,function(){return t.result.map(function(e){return e.toString()})})}var r=e.openCursor(),n=i.getKeysFromCursor(r),o=i.errorEvent(r);return s.race([n,o])}),c.first())},e.prototype.has=function(r){var n=this;return this.transaction("readonly").pipe(c.mergeMap(function(e){var t=n.getKeyRequest(e,r);return n.requestEventsAndMapTo(t,function(){return t.result!==undefined})}),c.first())},e.prototype.connect=function(){var e,t=this;try{e=indexedDB.open(this.dbName)}catch(r){return void this.database.error(new h)}this.createStore(e),s.race([this.successEvent(e),this.errorEvent(e)]).pipe(c.first()).subscribe({next:function(){t.database.next(e.result)},error:function(){t.database.error(new h)}})},e.prototype.createStore=function(t){var r=this;s.fromEvent(t,"upgradeneeded").pipe(c.first()).subscribe({next:function(){var e=r.storeName||u;t.result.objectStoreNames.contains(e)||t.result.createObjectStore(e),r.storeName=e}})},e.prototype.transaction=function(o){var i=this;return this.database.pipe(c.mergeMap(function(e){var t;try{if(i.storeName)t=e.transaction([i.storeName],o).objectStore(i.storeName);else try{t=e.transaction([u],o).objectStore(u),i.storeName=u}catch(r){t=e.transaction([f],o).objectStore(f),i.storeName=f,i.isStorePriorToV8=!0}}catch(n){return s.throwError(n)}return s.of(t)}))},e.prototype.successEvent=function(e){return s.fromEvent(e,"success")},e.prototype.errorEvent=function(e){return s.fromEvent(e,"error").pipe(c.mergeMap(function(){return s.throwError(e.error)}))},e.prototype.requestEventsAndMapTo=function(e,t){var r=this.successEvent(e).pipe(c.map(t)),n=this.errorEvent(e);return s.race([r,n])},e.prototype.getKeyRequest=function(e,t){return"getKey"in e?e.getKey(t):e.get(t)},e.prototype.getKeysFromCursor=function(e){var t=[];return this.successEvent(e).pipe(c.map(function(){return e.result}),c.tap(function(e){e&&(t.push(e.key.toString()),e["continue"]())}),c.filter(function(e){return!e}),c.map(function(){return t}))},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:undefined,decorators:[{type:t.Inject,args:[a]}]},{type:undefined,decorators:[{type:t.Inject,args:[p]}]},{type:undefined,decorators:[{type:t.Inject,args:[r]}]}]},e.ngInjectableDef=t.defineInjectable({factory:function(){return new e(t.inject(a),t.inject(p),t.inject(r))},token:e,providedIn:"root"}),e}(),I=function(){function e(e,t){void 0===e&&(e=""),void 0===t&&(t=""),this.prefix=e||(t?t+"_":"")}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.prefixKey(e)),r=null;if(t!==undefined&&null!==t)try{r=JSON.parse(t)}catch(n){return s.throwError(n)}return s.of(r)},e.prototype.setItem=function(e,t){if(t!==undefined&&null!==t){var r=null;try{r=JSON.stringify(t)}catch(n){return s.throwError(n)}try{localStorage.setItem(this.prefixKey(e),r)}catch(n){return s.throwError(n)}}return s.of(!0)},e.prototype.removeItem=function(e){return localStorage.removeItem(this.prefixKey(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)e.push(this.getUnprefixedKey(t));return s.of(e)},e.prototype.has=function(e){for(var t=0;t<localStorage.length;t+=1)if(e===this.getUnprefixedKey(t))return s.of(!0);return s.of(!1)},e.prototype.getUnprefixedKey=function(e){var t=localStorage.key(e);return null!==t?this.prefix?t.substr(this.prefix.length):t:null},e.prototype.prefixKey=function(e){return""+this.prefix+e},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:undefined,decorators:[{type:t.Inject,args:[n]}]},{type:undefined,decorators:[{type:t.Inject,args:[r]}]}]},e.ngInjectableDef=t.defineInjectable({factory:function(){return new e(t.inject(n),t.inject(r))},token:e,providedIn:"root"}),e}(),j=function(){function e(){this.memoryStorage=new Map}return Object.defineProperty(e.prototype,"size",{get:function(){return s.of(this.memoryStorage.size)},enumerable:!0,configurable:!0}),e.prototype.getItem=function(e){var t=this.memoryStorage.get(e);return s.of(t!==undefined?t:null)},e.prototype.setItem=function(e,t){return t!==undefined&&null!==t&&this.memoryStorage.set(e,t),s.of(!0)},e.prototype.removeItem=function(e){return this.memoryStorage["delete"](e),s.of(!0)},e.prototype.clear=function(){return this.memoryStorage.clear(),s.of(!0)},e.prototype.keys=function(){var e=Array.from(this.memoryStorage.keys());return s.of(e)},e.prototype.has=function(e){return s.of(this.memoryStorage.has(e))},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ngInjectableDef=t.defineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e}();function x(e,t,r,n,o){return(i.isPlatformBrowser(e)||i.isPlatformWorkerApp(e)||i.isPlatformWorkerUi(e))&&indexedDB!==undefined&&null!==indexedDB&&"open"in indexedDB?new b(r,n,o):i.isPlatformBrowser(e)&&localStorage!==undefined&&null!==localStorage&&"getItem"in localStorage?new I(t,o):new j}var S=function(){function e(){}return e.decorators=[{type:t.Injectable,args:[{providedIn:"root",useFactory:x,deps:[t.PLATFORM_ID,n,a,p,r]}]}],e.ngInjectableDef=t.defineInjectable({factory:function(){return x(t.inject(t.PLATFORM_ID),t.inject(n),t.inject(a),t.inject(p),t.inject(r))},token:e,providedIn:"root"}),e}(),w=function(){function e(){}return e.prototype.validate=function(e,t){switch(t.type){case"string":return this.validateString(e,t);case"number":case"integer":return this.validateNumber(e,t);case"boolean":return this.validateBoolean(e,t);case"array":return this.validateArray(e,t);case"object":return this.validateObject(e,t)}},e.prototype.validateString=function(e,t){if("string"!=typeof e)return!1;if(!this.validateConst(e,t))return!1;if(!this.validateEnum(e,t))return!1;if(t.maxLength!==undefined&&e.length>t.maxLength)return!1;if(t.minLength!==undefined&&e.length<t.minLength)return!1;if(t.pattern){var r=null;try{r=new RegExp(t.pattern)}catch(n){}if(r&&!r.test(e))return!1}return!0},e.prototype.validateNumber=function(e,t){return"number"==typeof e&&(!("integer"===t.type&&!Number.isInteger(e))&&(!!this.validateConst(e,t)&&(!!this.validateEnum(e,t)&&(!(t.multipleOf&&!Number.isInteger(e/t.multipleOf))&&(!(t.maximum!==undefined&&e>t.maximum)&&(!(t.exclusiveMaximum!==undefined&&e>=t.exclusiveMaximum)&&(!(t.minimum!==undefined&&e<t.minimum)&&!(t.exclusiveMinimum!==undefined&&e<=t.exclusiveMinimum))))))))},e.prototype.validateBoolean=function(e,t){return"boolean"==typeof e&&!!this.validateConst(e,t)},e.prototype.validateArray=function(e,t){var r,n;if(!Array.isArray(e))return!1;if(t.maxItems!==undefined&&e.length>t.maxItems)return!1;if(t.minItems!==undefined&&e.length<t.minItems)return!1;if(t.uniqueItems){var o=new Set(e);if(e.length!==o.size)return!1}try{for(var i=y(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.validateObject=function(e,t){var r,n;if(null===e||"object"!=typeof e)return!1;if(Object.keys(t.properties).length<Object.keys(e).length)return!1;if(t.required)try{for(var o=y(t.required),i=o.next();!i.done;i=o.next()){var a=i.value;if(!e.hasOwnProperty(a))return!1}}catch(s){r={error:s}}finally{try{i&&!i.done&&(n=o["return"])&&n.call(o)}finally{if(r)throw r.error}}for(var u in t.properties)if(t.properties.hasOwnProperty(u)&&e.hasOwnProperty(u)&&!this.validate(e[u],t.properties[u]))return!1;return!0},e.prototype.validateConst=function(e,t){return!t["const"]||e===t["const"]},e.prototype.validateEnum=function(e,t){return!t["enum"]||t["enum"].includes(e)},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ngInjectableDef=t.defineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e}(),E=function(){function e(e,t,r,n){void 0===t&&(t=new w),void 0===r&&(r=""),void 0===n&&(n=""),this.database=e,this.jsonValidator=t,this.LSPrefix=r,this.oldPrefix=n}return Object.defineProperty(e.prototype,"size",{get:function(){return this.database.size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this.size},enumerable:!0,configurable:!0}),e.prototype.getItem=function(e,r){var n=this;return void 0===r&&(r=null),this.database.getItem(e).pipe(this.catchIDBBroken(function(){return n.database.getItem(e)}),c.mergeMap(function(e){if(null===e)return s.of(null);if(r){var t="schema"in r?r.schema:r;return n.jsonValidator.validate(e,t)?s.of(e):s.throwError(new g)}return s.of(e)}))},e.prototype.setItem=function(e,t){var r=this;return this.database.setItem(e,t).pipe(this.catchIDBBroken(function(){return r.database.setItem(e,t)}))},e.prototype.removeItem=function(e){var t=this;return this.database.removeItem(e).pipe(this.catchIDBBroken(function(){return t.database.removeItem(e)}))},e.prototype.clear=function(){var e=this;return this.database.clear().pipe(this.catchIDBBroken(function(){return e.database.clear()}))},e.prototype.keys=function(){var e=this;return this.database.keys().pipe(this.catchIDBBroken(function(){return e.database.keys()}))},e.prototype.has=function(e){var t=this;return this.database.has(e).pipe(this.catchIDBBroken(function(){return t.database.has(e)}))},e.prototype.setItemSubscribe=function(e,t){this.setItem(e,t).subscribe({next:function(){},error:function(){}})},e.prototype.removeItemSubscribe=function(e){this.removeItem(e).subscribe({next:function(){},error:function(){}})},e.prototype.clearSubscribe=function(){this.clear().subscribe({next:function(){},error:function(){}})},e.prototype.catchIDBBroken=function(t){var r=this;return c.catchError(function(e){return e!==undefined&&null!==e&&e.message===m?(r.database=new I(r.LSPrefix,r.oldPrefix),t()):s.throwError(e)})},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:S},{type:w},{type:undefined,decorators:[{type:t.Inject,args:[n]}]},{type:undefined,decorators:[{type:t.Inject,args:[r]}]}]},e.ngInjectableDef=t.defineInjectable({factory:function(){return new e(t.inject(S),t.inject(w),t.inject(n),t.inject(r))},token:e,providedIn:"root"}),e}();e.LocalDatabase=S,e.LocalStorage=E,e.localStorageProviders=function P(e){return[e.prefix?{provide:r,useValue:e.prefix}:[],e.LSPrefix?{provide:n,useValue:e.LSPrefix}:[],e.IDBDBName?{provide:a,useValue:e.IDBDBName}:[],e.IDBStoreName?{provide:p,useValue:e.IDBStoreName}:[]]},e.DEFAULT_IDB_DB_NAME=o,e.DEFAULT_IDB_STORE_NAME=u,e.LOCAL_STORAGE_PREFIX=r,e.VALIDATION_ERROR=v,e.ValidationError=g,e.ɵa=x,e.ɵc=a,e.ɵd=p,e.ɵb=n,e.ɵe=w,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common"),require("rxjs"),require("rxjs/operators"),require("@angular/core")):"function"==typeof define&&define.amd?define("@ngx-pwa/local-storage",["exports","@angular/common","rxjs","rxjs/operators","@angular/core"],t):t((e["ngx-pwa"]=e["ngx-pwa"]||{},e["ngx-pwa"]["local-storage"]={}),e.ng.common,e.rxjs,e.rxjs.operators,e.ng.core)}(this,function(e,i,a,s,t){"use strict";var r=new t.InjectionToken("localStoragePrefix",{providedIn:"root",factory:function(){return""}}),n=new t.InjectionToken("localStoragePrefix",{providedIn:"root",factory:function(){return""}}),o="ngStorage",u=new t.InjectionToken("localStorageIDBDBName",{providedIn:"root",factory:function(){return o}}),c="storage",f="localStorage",p=new t.InjectionToken("localStorageIDBStoreName",{providedIn:"root",factory:function(){return null}});var l=function(e,t){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function d(e,t){function r(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function y(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 m="indexedDB is not working",h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.message=m,e}return d(e,t),e}(Error),v="Data stored is not valid against the provided JSON schema.\nCheck your JSON schema, otherwise it means data has been corrupted.",g=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.message=v,e}return d(e,t),e}(Error),b=function(){function e(e,t,r){void 0===e&&(e=o),void 0===t&&(t=null),void 0===r&&(r=""),this.storeName=null,this.dataPath="value",this.isStorePriorToV8=!1,this.dbName=r?r+"_"+e:e,this.storeName=t,this.database=new a.ReplaySubject(1),this.connect()}return Object.defineProperty(e.prototype,"size",{get:function(){var r=this;return this.transaction("readonly").pipe(s.mergeMap(function(e){var t=e.count();return r.requestEventsAndMapTo(t,function(){return t.result})}),s.first())},enumerable:!0,configurable:!0}),e.prototype.getItem=function(r){var n=this;return this.transaction("readonly").pipe(s.mergeMap(function(e){var t=e.get(r);return n.requestEventsAndMapTo(t,function(){if(t.result!==undefined&&null!==t.result){if(!n.isStorePriorToV8)return t.result;if(t.result[n.dataPath]!==undefined&&null!==t.result[n.dataPath])return t.result[n.dataPath]}return null})}),s.first())},e.prototype.setItem=function(i,a){var u=this;return a===undefined||null===a?this.removeItem(i):this.transaction("readwrite").pipe(s.mergeMap(function(o){var e=u.getKeyRequest(o,i);return u.requestEventsAndMapTo(e,function(){return e.result}).pipe(s.mergeMap(function(e){var t,r=u.isStorePriorToV8?((t={})[u.dataPath]=a,t):a,n=e===undefined?o.add(r,i):o.put(r,i);return u.requestEventsAndMapTo(n,function(){return!0})}))}),s.first())},e.prototype.removeItem=function(r){var n=this;return this.transaction("readwrite").pipe(s.mergeMap(function(e){var t=e["delete"](r);return n.requestEventsAndMapTo(t,function(){return!0})}),s.first())},e.prototype.clear=function(){var r=this;return this.transaction("readwrite").pipe(s.mergeMap(function(e){var t=e.clear();return r.requestEventsAndMapTo(t,function(){return!0})}),s.first())},e.prototype.keys=function(){var i=this;return this.transaction("readonly").pipe(s.mergeMap(function(e){if("getAllKeys"in e){var t=e.getAllKeys();return i.requestEventsAndMapTo(t,function(){return t.result.map(function(e){return e.toString()})})}var r=e.openCursor(),n=i.getKeysFromCursor(r),o=i.errorEvent(r);return a.race([n,o])}),s.first())},e.prototype.has=function(r){var n=this;return this.transaction("readonly").pipe(s.mergeMap(function(e){var t=n.getKeyRequest(e,r);return n.requestEventsAndMapTo(t,function(){return t.result!==undefined})}),s.first())},e.prototype.connect=function(){var e,t=this;try{e=indexedDB.open(this.dbName)}catch(r){return void this.database.error(new h)}this.createStore(e),a.race([this.successEvent(e),this.errorEvent(e)]).pipe(s.first()).subscribe({next:function(){t.database.next(e.result)},error:function(){t.database.error(new h)}})},e.prototype.createStore=function(t){var r=this;a.fromEvent(t,"upgradeneeded").pipe(s.first()).subscribe({next:function(){var e=r.storeName||c;t.result.objectStoreNames.contains(e)||t.result.createObjectStore(e),r.storeName=e}})},e.prototype.transaction=function(o){var i=this;return this.database.pipe(s.mergeMap(function(e){var t;try{if(i.storeName)t=e.transaction([i.storeName],o).objectStore(i.storeName);else try{t=e.transaction([c],o).objectStore(c),i.storeName=c}catch(r){t=e.transaction([f],o).objectStore(f),i.storeName=f,i.isStorePriorToV8=!0}}catch(n){return a.throwError(n)}return a.of(t)}))},e.prototype.successEvent=function(e){return a.fromEvent(e,"success")},e.prototype.errorEvent=function(e){return a.fromEvent(e,"error").pipe(s.mergeMap(function(){return a.throwError(e.error)}))},e.prototype.requestEventsAndMapTo=function(e,t){var r=this.successEvent(e).pipe(s.map(t)),n=this.errorEvent(e);return a.race([r,n])},e.prototype.getKeyRequest=function(e,t){return"getKey"in e?e.getKey(t):e.get(t)},e.prototype.getKeysFromCursor=function(e){var t=[];return this.successEvent(e).pipe(s.map(function(){return e.result}),s.tap(function(e){e&&(t.push(e.key.toString()),e["continue"]())}),s.filter(function(e){return!e}),s.map(function(){return t}))},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:undefined,decorators:[{type:t.Inject,args:[u]}]},{type:undefined,decorators:[{type:t.Inject,args:[p]}]},{type:undefined,decorators:[{type:t.Inject,args:[r]}]}]},e.ngInjectableDef=t.defineInjectable({factory:function(){return new e(t.inject(u),t.inject(p),t.inject(r))},token:e,providedIn:"root"}),e}(),I=function(){function e(e,t){void 0===e&&(e=""),void 0===t&&(t=""),this.prefix=e||(t?t+"_":"")}return Object.defineProperty(e.prototype,"size",{get:function(){return a.of(localStorage.length)},enumerable:!0,configurable:!0}),e.prototype.getItem=function(e){var t=localStorage.getItem(this.prefixKey(e)),r=null;if(t!==undefined&&null!==t)try{r=JSON.parse(t)}catch(n){return a.throwError(n)}return a.of(r)},e.prototype.setItem=function(e,t){if(t===undefined||null===t)return this.removeItem(e);var r=null;try{r=JSON.stringify(t)}catch(n){return a.throwError(n)}try{localStorage.setItem(this.prefixKey(e),r)}catch(n){return a.throwError(n)}return a.of(!0)},e.prototype.removeItem=function(e){return localStorage.removeItem(this.prefixKey(e)),a.of(!0)},e.prototype.clear=function(){return localStorage.clear(),a.of(!0)},e.prototype.keys=function(){for(var e=[],t=0;t<localStorage.length;t+=1)e.push(this.getUnprefixedKey(t));return a.of(e)},e.prototype.has=function(e){for(var t=0;t<localStorage.length;t+=1)if(e===this.getUnprefixedKey(t))return a.of(!0);return a.of(!1)},e.prototype.getUnprefixedKey=function(e){var t=localStorage.key(e);return null!==t?this.prefix?t.substr(this.prefix.length):t:null},e.prototype.prefixKey=function(e){return""+this.prefix+e},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:undefined,decorators:[{type:t.Inject,args:[n]}]},{type:undefined,decorators:[{type:t.Inject,args:[r]}]}]},e.ngInjectableDef=t.defineInjectable({factory:function(){return new e(t.inject(n),t.inject(r))},token:e,providedIn:"root"}),e}(),j=function(){function e(){this.memoryStorage=new Map}return Object.defineProperty(e.prototype,"size",{get:function(){return a.of(this.memoryStorage.size)},enumerable:!0,configurable:!0}),e.prototype.getItem=function(e){var t=this.memoryStorage.get(e);return a.of(t!==undefined?t:null)},e.prototype.setItem=function(e,t){return t===undefined||null===t?this.removeItem(e):(this.memoryStorage.set(e,t),a.of(!0))},e.prototype.removeItem=function(e){return this.memoryStorage["delete"](e),a.of(!0)},e.prototype.clear=function(){return this.memoryStorage.clear(),a.of(!0)},e.prototype.keys=function(){var e=Array.from(this.memoryStorage.keys());return a.of(e)},e.prototype.has=function(e){return a.of(this.memoryStorage.has(e))},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ngInjectableDef=t.defineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e}();function x(e,t,r,n,o){return(i.isPlatformBrowser(e)||i.isPlatformWorkerApp(e)||i.isPlatformWorkerUi(e))&&indexedDB!==undefined&&null!==indexedDB&&"open"in indexedDB?new b(r,n,o):i.isPlatformBrowser(e)&&localStorage!==undefined&&null!==localStorage&&"getItem"in localStorage?new I(t,o):new j}var S=function(){function e(){}return e.decorators=[{type:t.Injectable,args:[{providedIn:"root",useFactory:x,deps:[t.PLATFORM_ID,n,u,p,r]}]}],e.ngInjectableDef=t.defineInjectable({factory:function(){return x(t.inject(t.PLATFORM_ID),t.inject(n),t.inject(u),t.inject(p),t.inject(r))},token:e,providedIn:"root"}),e}(),w=function(){function e(){}return e.prototype.validate=function(e,t){switch(t.type){case"string":return this.validateString(e,t);case"number":case"integer":return this.validateNumber(e,t);case"boolean":return this.validateBoolean(e,t);case"array":return this.validateArray(e,t);case"object":return this.validateObject(e,t)}},e.prototype.validateString=function(e,t){if("string"!=typeof e)return!1;if(!this.validateConst(e,t))return!1;if(!this.validateEnum(e,t))return!1;if(t.maxLength!==undefined&&e.length>t.maxLength)return!1;if(t.minLength!==undefined&&e.length<t.minLength)return!1;if(t.pattern){var r=null;try{r=new RegExp(t.pattern)}catch(n){}if(r&&!r.test(e))return!1}return!0},e.prototype.validateNumber=function(e,t){return"number"==typeof e&&(!("integer"===t.type&&!Number.isInteger(e))&&(!!this.validateConst(e,t)&&(!!this.validateEnum(e,t)&&(!(t.multipleOf&&!Number.isInteger(e/t.multipleOf))&&(!(t.maximum!==undefined&&e>t.maximum)&&(!(t.exclusiveMaximum!==undefined&&e>=t.exclusiveMaximum)&&(!(t.minimum!==undefined&&e<t.minimum)&&!(t.exclusiveMinimum!==undefined&&e<=t.exclusiveMinimum))))))))},e.prototype.validateBoolean=function(e,t){return"boolean"==typeof e&&!!this.validateConst(e,t)},e.prototype.validateArray=function(e,t){var r,n;if(!Array.isArray(e))return!1;if(t.maxItems!==undefined&&e.length>t.maxItems)return!1;if(t.minItems!==undefined&&e.length<t.minItems)return!1;if(t.uniqueItems){var o=new Set(e);if(e.length!==o.size)return!1}if(Array.isArray(t.items))return this.validateTuple(e,t.items);try{for(var i=y(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.validateTuple=function(e,t){if(e.length!==t.length)return!1;for(var r=0;r<t.length;r+=1)if(!this.validate(e[r],t[r]))return!1;return!0},e.prototype.validateObject=function(e,t){var r,n;if(null===e||"object"!=typeof e)return!1;if(Object.keys(t.properties).length<Object.keys(e).length)return!1;if(t.required)try{for(var o=y(t.required),i=o.next();!i.done;i=o.next()){var a=i.value;if(!e.hasOwnProperty(a))return!1}}catch(s){r={error:s}}finally{try{i&&!i.done&&(n=o["return"])&&n.call(o)}finally{if(r)throw r.error}}for(var u in t.properties)if(t.properties.hasOwnProperty(u)&&e.hasOwnProperty(u)&&!this.validate(e[u],t.properties[u]))return!1;return!0},e.prototype.validateConst=function(e,t){return!t["const"]||e===t["const"]},e.prototype.validateEnum=function(e,t){return!t["enum"]||t["enum"].includes(e)},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ngInjectableDef=t.defineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e}(),E=function(){function e(e,t,r,n){void 0===t&&(t=new w),void 0===r&&(r=""),void 0===n&&(n=""),this.database=e,this.jsonValidator=t,this.LSPrefix=r,this.oldPrefix=n}return Object.defineProperty(e.prototype,"size",{get:function(){return this.database.size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this.size},enumerable:!0,configurable:!0}),e.prototype.getItem=function(e,r){var n=this;return void 0===r&&(r=null),this.database.getItem(e).pipe(this.catchIDBBroken(function(){return n.database.getItem(e)}),s.mergeMap(function(e){if(null===e)return a.of(null);if(r){var t="schema"in r?r.schema:r;return n.jsonValidator.validate(e,t)?a.of(e):a.throwError(new g)}return a.of(e)}))},e.prototype.setItem=function(e,t){var r=this;return this.database.setItem(e,t).pipe(this.catchIDBBroken(function(){return r.database.setItem(e,t)}))},e.prototype.removeItem=function(e){var t=this;return this.database.removeItem(e).pipe(this.catchIDBBroken(function(){return t.database.removeItem(e)}))},e.prototype.clear=function(){var e=this;return this.database.clear().pipe(this.catchIDBBroken(function(){return e.database.clear()}))},e.prototype.keys=function(){var e=this;return this.database.keys().pipe(this.catchIDBBroken(function(){return e.database.keys()}))},e.prototype.has=function(e){var t=this;return this.database.has(e).pipe(this.catchIDBBroken(function(){return t.database.has(e)}))},e.prototype.setItemSubscribe=function(e,t){this.setItem(e,t).subscribe({next:function(){},error:function(){}})},e.prototype.removeItemSubscribe=function(e){this.removeItem(e).subscribe({next:function(){},error:function(){}})},e.prototype.clearSubscribe=function(){this.clear().subscribe({next:function(){},error:function(){}})},e.prototype.catchIDBBroken=function(t){var r=this;return s.catchError(function(e){return e!==undefined&&null!==e&&e.message===m?(r.database=new I(r.LSPrefix,r.oldPrefix),t()):a.throwError(e)})},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:S},{type:w},{type:undefined,decorators:[{type:t.Inject,args:[n]}]},{type:undefined,decorators:[{type:t.Inject,args:[r]}]}]},e.ngInjectableDef=t.defineInjectable({factory:function(){return new e(t.inject(S),t.inject(w),t.inject(n),t.inject(r))},token:e,providedIn:"root"}),e}();e.LocalDatabase=S,e.LocalStorage=E,e.localStorageProviders=function P(e){return[e.prefix?{provide:r,useValue:e.prefix}:[],e.LSPrefix?{provide:n,useValue:e.LSPrefix}:[],e.IDBDBName?{provide:u,useValue:e.IDBDBName}:[],e.IDBStoreName?{provide:p,useValue:e.IDBStoreName}:[]]},e.DEFAULT_IDB_DB_NAME=o,e.DEFAULT_IDB_STORE_NAME=c,e.LOCAL_STORAGE_PREFIX=r,e.VALIDATION_ERROR=v,e.ValidationError=g,e.ɵa=x,e.ɵc=u,e.ɵd=p,e.ɵb=n,e.ɵe=w,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=ngx-pwa-local-storage.umd.min.js.map |
@@ -111,7 +111,5 @@ /** | ||
setItem(key, data) { | ||
/* Storing `null` or `undefined` is known to cause issues in some browsers. | ||
* So it's useless, not storing anything in this case */ | ||
/* Storing `undefined` or `null` in `localStorage` can cause issues in some browsers so removing item instead */ | ||
if ((data === undefined) || (data === null)) { | ||
/* Trigger success */ | ||
return of(true); | ||
return this.removeItem(key); | ||
} | ||
@@ -540,2 +538,2 @@ /* Open a transaction in write mode */ | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXhlZGRiLWRhdGFiYXNlLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQG5neC1wd2EvbG9jYWwtc3RvcmFnZS8iLCJzb3VyY2VzIjpbImxpYi9kYXRhYmFzZXMvaW5kZXhlZGRiLWRhdGFiYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUNuRCxPQUFPLEVBQWMsYUFBYSxFQUFFLFNBQVMsRUFBRSxFQUFFLEVBQUUsVUFBVSxFQUFFLElBQUksRUFBRSxNQUFNLE1BQU0sQ0FBQztBQUNsRixPQUFPLEVBQUUsR0FBRyxFQUFFLFFBQVEsRUFBRSxLQUFLLEVBQUUsR0FBRyxFQUFFLE1BQU0sRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBR25FLE9BQU8sRUFDTCxXQUFXLEVBQUUsY0FBYyxFQUFFLHNCQUFzQixFQUFFLGtDQUFrQyxFQUN2RixvQkFBb0IsRUFBRSxtQkFBbUIsRUFDMUMsTUFBTSxXQUFXLENBQUM7QUFDbkIsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLGVBQWUsQ0FBQzs7O0FBSy9DLE1BQU0sT0FBTyxpQkFBaUI7Ozs7Ozs7SUF3RDVCLFlBQ3VCLE1BQU0sR0FBRyxtQkFBbUIsRUFDekIsWUFBMkIsSUFBSTtJQUN2RCx3Q0FB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dWVzdDxJREJDdXJzb3JXaXRoVmFsdWUgfCBudWxsPik6IE9ic2VydmFibGU8c3RyaW5nW10+IHtcblxuICAgIC8qIEtleXMgd2lsbCBiZSBzdG9yZWQgaGVyZSAqL1xuICAgIGNvbnN0IGtleXM6IHN0cmluZ1tdID0gW107XG5cbiAgICAvKiBMaXN0ZW4gdG8gc3VjY2VzcyBldmVudCAqL1xuICAgIHJldHVybiB0aGlzLnN1Y2Nlc3NFdmVudChyZXF1ZXN0KS5waXBlKFxuICAgICAgLyogTWFwIHRvIHRoZSByZXN1bHQgKi9cbiAgICAgIG1hcCgoKSA9PiByZXF1ZXN0LnJlc3VsdCksXG4gICAgICAvKiBJdGVyYXRlIG9uIHRoZSBjdXJzb3IgKi9cbiAgICAgIHRhcCgoY3Vyc29yKSA9PiAge1xuXG4gICAgICAgIGlmIChjdXJzb3IpIHtcblxuICAgICAgICAgIC8qIFRoaXMgbGliIG9ubHkgYWxsb3dzIHN0cmluZyBrZXlzLCBidXQgdXNlciBjb3VsZCBoYXZlIGFkZGVkIG90aGVyIHR5cGVzIG9mIGtleXMgZnJvbSBvdXRzaWRlICovXG4gICAgICAgICAga2V5cy5wdXNoKGN1cnNvci5rZXkudG9TdHJpbmcoKSk7XG5cbiAgICAgICAgICBjdXJzb3IuY29udGludWUoKTtcblxuICAgICAgICB9XG5cbiAgICAgIH0pLFxuICAgICAgLyogV2FpdCB1bnRpbCB0aGUgaXRlcmF0aW9uIGlzIG92ZXIgKi9cbiAgICAgIGZpbHRlcigoY3Vyc29yKSA9PiAhY3Vyc29yKSxcbiAgICAgIC8qIE1hcCB0byB0aGUgcmV0cmlldmVkIGtleXMgKi9cbiAgICAgIG1hcCgoKSA9PiBrZXlzKVxuICAgICk7XG5cbiAgfVxuXG59XG4iXX0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXhlZGRiLWRhdGFiYXNlLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQ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C8qIEl0ZXJhdGUgb24gdGhlIGN1cnNvciAqL1xuICAgICAgdGFwKChjdXJzb3IpID0+ICB7XG5cbiAgICAgICAgaWYgKGN1cnNvcikge1xuXG4gICAgICAgICAgLyogVGhpcyBsaWIgb25seSBhbGxvd3Mgc3RyaW5nIGtleXMsIGJ1dCB1c2VyIGNvdWxkIGhhdmUgYWRkZWQgb3RoZXIgdHlwZXMgb2Yga2V5cyBmcm9tIG91dHNpZGUgKi9cbiAgICAgICAgICBrZXlzLnB1c2goY3Vyc29yLmtleS50b1N0cmluZygpKTtcblxuICAgICAgICAgIGN1cnNvci5jb250aW51ZSgpO1xuXG4gICAgICAgIH1cblxuICAgICAgfSksXG4gICAgICAvKiBXYWl0IHVudGlsIHRoZSBpdGVyYXRpb24gaXMgb3ZlciAqL1xuICAgICAgZmlsdGVyKChjdXJzb3IpID0+ICFjdXJzb3IpLFxuICAgICAgLyogTWFwIHRvIHRoZSByZXRyaWV2ZWQga2V5cyAqL1xuICAgICAgbWFwKCgpID0+IGtleXMpXG4gICAgKTtcblxuICB9XG5cbn1cbiJdfQ== |
@@ -62,21 +62,22 @@ /** | ||
setItem(key, data) { | ||
/* Storing `undefined` or `null` in `localStorage` can cause issues in some browsers and has no sense */ | ||
if ((data !== undefined) && (data !== null)) { | ||
/** @type {?} */ | ||
let serializedData = null; | ||
/* Try to stringify (can fail on circular references) */ | ||
try { | ||
serializedData = JSON.stringify(data); | ||
} | ||
catch (error) { | ||
return throwError((/** @type {?} */ (error))); | ||
} | ||
/* Can fail if storage quota is exceeded */ | ||
try { | ||
localStorage.setItem(this.prefixKey(key), serializedData); | ||
} | ||
catch (error) { | ||
return throwError((/** @type {?} */ (error))); | ||
} | ||
/* Storing `undefined` or `null` in `localStorage` can cause issues in some browsers so removing item instead */ | ||
if ((data === undefined) || (data === null)) { | ||
return this.removeItem(key); | ||
} | ||
/** @type {?} */ | ||
let serializedData = null; | ||
/* Try to stringify (can fail on circular references) */ | ||
try { | ||
serializedData = JSON.stringify(data); | ||
} | ||
catch (error) { | ||
return throwError((/** @type {?} */ (error))); | ||
} | ||
/* Can fail if storage quota is exceeded */ | ||
try { | ||
localStorage.setItem(this.prefixKey(key), serializedData); | ||
} | ||
catch (error) { | ||
return throwError((/** @type {?} */ (error))); | ||
} | ||
/* Wrap in a RxJS `Observable` to be consistent with other storages */ | ||
@@ -181,2 +182,2 @@ return of(true); | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWxzdG9yYWdlLWRhdGFiYXNlLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQG5neC1wd2EvbG9jYWwtc3RvcmFnZS8iLCJzb3VyY2VzIjpbImxpYi9kYXRhYmFzZXMvbG9jYWxzdG9yYWdlLWRhdGFiYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUNuRCxPQUFPLEVBQWMsRUFBRSxFQUFFLFVBQVUsRUFBRSxNQUFNLE1BQU0sQ0FBQztBQUdsRCxPQUFPLEVBQUUsb0JBQW9CLEVBQUUsU0FBUyxFQUFFLE1BQU0sV0FBVyxDQUFDOzs7QUFLNUQsTUFBTSxPQUFPLG9CQUFvQjs7Ozs7O0lBc0IvQixZQUNxQixTQUFTLEdBQUcsRUFBRTtJQUNqQyx3Q0FBd0M7SUFDVixTQUFTLEdBQUcsRUFBRTtRQUc1QywyRkFBMkY7UUFDM0YsSUFBSSxDQUFDLE1BQU0sR0FBRyxTQUFTLElBQUksQ0FBQyxTQUFTLENBQUMsQ0FBQyxDQUFDLEdBQUcsU0FBUyxHQUFHLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDO0lBRWhFLENBQUM7Ozs7O0lBckJELElBQUksSUFBSTtRQUVOLHNFQUFzRTtRQUN0RSxPQUFPLEVBQUUsQ0FBQyxZQ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GEga2V5XG4gICAqIEBwYXJhbSBrZXkgVGhlIGtleSBuYW1lXG4gICAqIEByZXR1cm5zIFRoZSBwcmVmaXhlZCBrZXkgbmFtZVxuICAgKi9cbiAgcHJpdmF0ZSBwcmVmaXhLZXkoa2V5OiBzdHJpbmcpOiBzdHJpbmcge1xuXG4gICAgcmV0dXJuIGAke3RoaXMucHJlZml4fSR7a2V5fWA7XG5cbiAgfVxuXG59XG4iXX0= |
@@ -43,6 +43,7 @@ /** | ||
setItem(key, data) { | ||
/* Storing `undefined` or `null` in `localStorage` is useless */ | ||
if ((data !== undefined) && (data !== null)) { | ||
this.memoryStorage.set(key, data); | ||
/* Storing `undefined` or `null` in `localStorage` is useless, so removing item instead */ | ||
if ((data === undefined) || (data === null)) { | ||
return this.removeItem(key); | ||
} | ||
this.memoryStorage.set(key, data); | ||
/* Wrap in a RxJS `Observable` to be consistent with other storages */ | ||
@@ -105,2 +106,2 @@ return of(true); | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVtb3J5LWRhdGFiYXNlLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQG5neC1wd2EvbG9jYWwtc3RvcmFnZS8iLCJzb3VyY2VzIjpbImxpYi9kYXRhYmFzZXMvbWVtb3J5LWRhdGFiYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQzNDLE9BQU8sRUFBYyxFQUFFLEVBQUUsTUFBTSxNQUFNLENBQUM7O0FBT3RDLE1BQU0sT0FBTyxjQUFjO0lBSDNCOzs7O1FBUVUsa0JBQWEsR0FBRyxJQUFJLEdBQUcsRUFBZSxDQUFDO0tBb0doRDs7Ozs7SUEvRkMsSUFBSSxJQUFJO1FBRU4sc0VBQXNFO1FBQ3RFLE9BQU8sRUFBRSxDQUFDLElBQUksQ0FBQyxhQUFhLENBQUMs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W10+IHtcblxuICAgIC8qIFRyYW5zZm9ybSB0byBhIGNsYXNzaWMgYXJyYXkgZm9yIHRoZSBBUEkgdG8gYmUgY29uc2lzdGVudCAqL1xuICAgIGNvbnN0IGtleXMgPSBBcnJheS5mcm9tKHRoaXMubWVtb3J5U3RvcmFnZS5rZXlzKCkpO1xuXG4gICAgLyogV3JhcCBpbiBhIFJ4SlMgYE9ic2VydmFibGVgIHRvIGJlIGNvbnNpc3RlbnQgd2l0aCBvdGhlciBzdG9yYWdlcyAqL1xuICAgIHJldHVybiBvZihrZXlzKTtcblxuICB9XG5cbiAgLyoqXG4gICAqIENoZWNrIGlmIGEga2V5IGV4aXN0cyBpbiBtZW1vcnlcbiAgICogQHBhcmFtIGtleSBLZXkgbmFtZVxuICAgKiBAcmV0dXJucyBhIFJ4SlMgYE9ic2VydmFibGVgIHRlbGxpbmcgaWYgdGhlIGtleSBleGlzdHMgb3Igbm90XG4gICAqL1xuICBoYXMoa2V5OiBzdHJpbmcpOiBPYnNlcnZhYmxlPGJvb2xlYW4+IHtcblxuICAgIC8qIFdyYXAgaW4gYSBSeEpTIGBPYnNlcnZhYmxlYCB0byBiZSBjb25zaXN0ZW50IHdpdGggb3RoZXIgc3RvcmFnZXMgKi9cbiAgICByZXR1cm4gb2YodGhpcy5tZW1vcnlTdG9yYWdlLmhhcyhrZXkpKTtcblxuICB9XG5cbn1cbiJdfQ== |
@@ -173,3 +173,3 @@ /** | ||
/** | ||
* Schema for the values of an array. | ||
* Schema for the values of an array, or array of schemas for a tuple. | ||
* @type {?} | ||
@@ -258,2 +258,2 @@ */ | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoianNvbi1zY2hlbWEuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Abmd4LXB3YS9sb2NhbC1zdG9yYWdlLyIsInNvdXJjZXMiOlsibGliL3ZhbGlkYXRpb24vanNvbi1zY2hlbWEudHMiXSwibmFtZXMiOltdLCJtY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m11c3QqKiBoYXZlIGEgYHR5cGVgLlxuICogQHNlZSBodHRwczovL2dpdGh1Yi5jb20vY3lyaWxsZXR1emkvYW5ndWxhci1hc3luYy1sb2NhbC1zdG9yYWdlL2Jsb2IvbWFzdGVyL2RvY3MvVkFMSURBVElPTi5tZFxuICovXG5leHBvcnQgdHlwZSBKU09OU2NoZW1hID0gSlNPTlNjaGVtYVN0cmluZyB8IEpTT05TY2hlbWFOdW1iZXIgfCBKU09OU2NoZW1hSW50ZWdlciB8IEpTT05TY2hlbWFCb29sZWFuIHwgSlNPTlNjaGVtYUFycmF5IHwgSlNPTlNjaGVtYU9iamVjdDtcbiJdfQ== |
@@ -36,3 +36,3 @@ /** | ||
* @param {?} schema Schema describing the string | ||
* @return {?} | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -73,3 +73,3 @@ validateString(data, schema) { | ||
* @param {?} schema Schema describing the number or integer | ||
* @return {?} | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -112,3 +112,3 @@ validateNumber(data, schema) { | ||
* @param {?} schema Schema describing the boolean | ||
* @return {?} | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -129,3 +129,3 @@ validateBoolean(data, schema) { | ||
* @param {?} schema Schema describing the array | ||
* @return {?} | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -150,2 +150,6 @@ validateArray(data, schema) { | ||
} | ||
/* Specific test for tuples */ | ||
if (Array.isArray(schema.items)) { | ||
return this.validateTuple(data, schema.items); | ||
} | ||
/* Validate all the values in array */ | ||
@@ -160,2 +164,21 @@ for (const value of data) { | ||
/** | ||
* Validate a tuple (array with fixed length and multiple types) | ||
* @private | ||
* @param {?} data Data to validate | ||
* @param {?} schemas Schemas describing the tuple | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
validateTuple(data, schemas) { | ||
/* Tuples have a fixed length */ | ||
if (data.length !== schemas.length) { | ||
return false; | ||
} | ||
for (let i = 0; i < schemas.length; i += 1) { | ||
if (!this.validate(data[i], schemas[i])) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
/** | ||
* Validate an object | ||
@@ -165,3 +188,3 @@ * @private | ||
* @param {?} schema JSON schema describing the object | ||
* @return {?} | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -203,3 +226,3 @@ validateObject(data, schema) { | ||
* @param {?} schema JSON schema describing the constant | ||
* @return {?} | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -217,3 +240,3 @@ validateConst(data, schema) { | ||
* @param {?} schema JSON schema describing the enum | ||
* @return {?} | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -234,2 +257,2 @@ validateEnum(data, schema) { | ||
/** @nocollapse */ JSONValidator.ngInjectableDef = i0.defineInjectable({ factory: function JSONValidator_Factory() { return new JSONValidator(); }, token: JSONValidator, providedIn: "root" }); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoianNvbi12YWxpZGF0b3IuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Abmd4LXB3YS9sb2NhbC1zdG9yYWdlLyIsInNvdXJjZXMiOlsibGliL3ZhbGlkYXRpb24vanNvbi12YWxpZGF0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7O0FBUzNDLE1BQU0sT0FBTyxhQUFhOzs7Ozs7Ozs7SUFVeEIsUUFBUSxDQUFDLElBQVMsRUFBRSxNQUFrQjtRQUVwQyxRQUFRLE1BQU0sQ0FBQyxJQUFJLEVBQUU7WUFFbkIsS0FBSyxRQUFRO2dCQUNYLE9BQU8sSUFBSSxDQUFDLGNBQWMsQ0FBQyxJQUFJLEVBQUUsTUFBTSxDQUFDLENBQUM7W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Ki9cbiAgICByZXR1cm4gKChzY2hlbWEuZW51bSBhcyBhbnlbXSkuaW5jbHVkZXMoZGF0YSkpO1xuXG4gIH1cblxufVxuIl19 |
@@ -147,7 +147,5 @@ /** | ||
var _this = this; | ||
/* Storing `null` or `undefined` is known to cause issues in some browsers. | ||
* So it's useless, not storing anything in this case */ | ||
/* Storing `undefined` or `null` in `localStorage` can cause issues in some browsers so removing item instead */ | ||
if ((data === undefined) || (data === null)) { | ||
/* Trigger success */ | ||
return of(true); | ||
return this.removeItem(key); | ||
} | ||
@@ -710,2 +708,2 @@ /* Open a transaction in write mode */ | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXhlZGRiLWRhdGFiYXNlLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQG5neC1wd2EvbG9jYWwtc3RvcmFnZS8iLCJzb3VyY2VzIjpbImxpYi9kYXRhYmFzZXMvaW5kZXhlZGRiLWRhdGFiYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUNuRCxPQUFPLEVBQWMsYUFBYSxFQUFFLFNBQVMsRUFBRSxFQUFFLEVBQUUsVUFBVSxFQUFFLElBQUksRUFBRSxNQUFNLE1BQU0sQ0FBQztBQUNsRixPQUFPLEVBQUUsR0FBRyxFQUFFLFFBQVEsRUFBRSxLQUFLLEVBQUUsR0FBRyxFQUFFLE1BQU0sRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBR25FLE9BQU8sRUFDTCxXQUFXLEVBQUUsY0FBYyxFQUFFLHNCQUFzQixFQUFFLGtDQUFrQyxFQUN2RixvQkFBb0IsRUFBRSxtQkFBbUIsRUFDMUMsTUFBTSxXQUFXLENBQUM7QUFDbkIsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLGVBQWUsQ0FBQzs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1cnNvcihyZXF1ZXN0OiBJREJSZXF1ZXN0PElEQkN1cnNvcldpdGhWYWx1ZSB8IG51bGw+KTogT2JzZXJ2YWJsZTxzdHJpbmdbXT4ge1xuXG4gICAgLyogS2V5cyB3aWxsIGJlIHN0b3JlZCBoZXJlICovXG4gICAgY29uc3Qga2V5czogc3RyaW5nW10gPSBbXTtcblxuICAgIC8qIExpc3RlbiB0byBzdWNjZXNzIGV2ZW50ICovXG4gICAgcmV0dXJuIHRoaXMuc3VjY2Vzc0V2ZW50KHJlcXVlc3QpLnBpcGUoXG4gICAgICAvKiBNYXAgdG8gdGhlIHJlc3VsdCAqL1xuICAgICAgbWFwKCgpID0+IHJlcXVlc3QucmVzdWx0KSxcbiAgICAgIC8qIEl0ZXJhdGUgb24gdGhlIGN1cnNvciAqL1xuICAgICAgdGFwKChjdXJzb3IpID0+ICB7XG5cbiAgICAgICAgaWYgKGN1cnNvcikge1xuXG4gICAgICAgICAgLyogVGhpcyBsaWIgb25seSBhbGxvd3Mgc3RyaW5nIGtleXMsIGJ1dCB1c2VyIGNvdWxkIGhhdmUgYWRkZWQgb3RoZXIgdHlwZXMgb2Yga2V5cyBmcm9tIG91dHNpZGUgKi9cbiAgICAgICAgICBrZXlzLnB1c2goY3Vyc29yLmtleS50b1N0cmluZygpKTtcblxuICAgICAgICAgIGN1cnNvci5jb250aW51ZSgpO1xuXG4gICAgICAgIH1cblxuICAgICAgfSksXG4gICAgICAvKiBXYWl0IHVudGlsIHRoZSBpdGVyYXRpb24gaXMgb3ZlciAqL1xuICAgICAgZmlsdGVyKChjdXJzb3IpID0+ICFjdXJzb3IpLFxuICAgICAgLyogTWFwIHRvIHRoZSByZXRyaWV2ZWQga2V5cyAqL1xuICAgICAgbWFwKCgpID0+IGtleXMpXG4gICAgKTtcblxuICB9XG5cbn1cbiJdfQ== |
@@ -94,21 +94,22 @@ /** | ||
function (key, data) { | ||
/* Storing `undefined` or `null` in `localStorage` can cause issues in some browsers and has no sense */ | ||
if ((data !== undefined) && (data !== null)) { | ||
/** @type {?} */ | ||
var serializedData = null; | ||
/* Try to stringify (can fail on circular references) */ | ||
try { | ||
serializedData = JSON.stringify(data); | ||
} | ||
catch (error) { | ||
return throwError((/** @type {?} */ (error))); | ||
} | ||
/* Can fail if storage quota is exceeded */ | ||
try { | ||
localStorage.setItem(this.prefixKey(key), serializedData); | ||
} | ||
catch (error) { | ||
return throwError((/** @type {?} */ (error))); | ||
} | ||
/* Storing `undefined` or `null` in `localStorage` can cause issues in some browsers so removing item instead */ | ||
if ((data === undefined) || (data === null)) { | ||
return this.removeItem(key); | ||
} | ||
/** @type {?} */ | ||
var serializedData = null; | ||
/* Try to stringify (can fail on circular references) */ | ||
try { | ||
serializedData = JSON.stringify(data); | ||
} | ||
catch (error) { | ||
return throwError((/** @type {?} */ (error))); | ||
} | ||
/* Can fail if storage quota is exceeded */ | ||
try { | ||
localStorage.setItem(this.prefixKey(key), serializedData); | ||
} | ||
catch (error) { | ||
return throwError((/** @type {?} */ (error))); | ||
} | ||
/* Wrap in a RxJS `Observable` to be consistent with other storages */ | ||
@@ -275,2 +276,2 @@ return of(true); | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWxzdG9yYWdlLWRhdGFiYXNlLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQG5neC1wd2EvbG9jYWwtc3RvcmFnZS8iLCJzb3VyY2VzIjpbImxpYi9kYXRhYmFzZXMvbG9jYWxzdG9yYWdlLWRhdGFiYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUNuRCxPQUFPLEVBQWMsRUFBRSxFQUFFLFVBQVUsRUFBRSxNQUFNLE1BQU0sQ0FBQztBQUdsRCxPQUFPLEVBQUUsb0JBQW9CLEVBQUUsU0FBUyxFQUFFLE1BQU0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EBwYXJhbSBpbmRleCBJbmRleCBvZiB0aGUga2V5XG4gICAqIEByZXR1cm5zIFRoZSB1bnByZWZpeGVkIGtleSBuYW1lIGlmIGV4aXN0cywgYG51bGxgIG90aGVyd2lzZVxuICAgKi9cbiAgcHJpdmF0ZSBnZXRVbnByZWZpeGVkS2V5KGluZGV4OiBudW1iZXIpOiBzdHJpbmcgfCBudWxsIHtcblxuICAgIC8qIEdldCB0aGUga2V5IGluIHN0b3JhZ2U6IG1heSBoYXZlIGEgcHJlZml4ICovXG4gICAgY29uc3QgcHJlZml4ZWRLZXkgPSBsb2NhbFN0b3JhZ2Uua2V5KGluZGV4KTtcblxuICAgIGlmIChwcmVmaXhlZEtleSAhPT0gbnVsbCkge1xuXG4gICAgICAvKiBJZiBubyBwcmVmaXgsIHRoZSBrZXkgaXMgYWxyZWFkeSBnb29kLCBvdGhlcndyaXRlIHN0cmlwIHRoZSBwcmVmaXggKi9cbiAgICAgIHJldHVybiAhdGhpcy5wcmVmaXggPyBwcmVmaXhlZEtleSA6IHByZWZpeGVkS2V5LnN1YnN0cih0aGlzLnByZWZpeC5sZW5ndGgpO1xuXG4gICAgfVxuXG4gICAgcmV0dXJuIG51bGw7XG5cbiAgfVxuXG4gIC8qKlxuICAgKiBBZGQgdGhlIHByZWZpeCB0byBhIGtleVxuICAgKiBAcGFyYW0ga2V5IFRoZSBrZXkgbmFtZVxuICAgKiBAcmV0dXJucyBUaGUgcHJlZml4ZWQga2V5IG5hbWVcbiAgICovXG4gIHByaXZhdGUgcHJlZml4S2V5KGtleTogc3RyaW5nKTogc3RyaW5nIHtcblxuICAgIHJldHVybiBgJHt0aGlzLnByZWZpeH0ke2tleX1gO1xuXG4gIH1cblxufVxuIl19 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWxzdG9yYWdlLWRhdGFiYXNlLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQG5neC1wd2EvbG9jYWwtc3RvcmFnZ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BBZGQgdGhlIHByZWZpeCB0byBhIGtleVxuICAgKiBAcGFyYW0ga2V5IFRoZSBrZXkgbmFtZVxuICAgKiBAcmV0dXJucyBUaGUgcHJlZml4ZWQga2V5IG5hbWVcbiAgICovXG4gIHByaXZhdGUgcHJlZml4S2V5KGtleTogc3RyaW5nKTogc3RyaW5nIHtcblxuICAgIHJldHVybiBgJHt0aGlzLnByZWZpeH0ke2tleX1gO1xuXG4gIH1cblxufVxuIl19 |
@@ -73,6 +73,7 @@ /** | ||
function (key, data) { | ||
/* Storing `undefined` or `null` in `localStorage` is useless */ | ||
if ((data !== undefined) && (data !== null)) { | ||
this.memoryStorage.set(key, data); | ||
/* Storing `undefined` or `null` in `localStorage` is useless, so removing item instead */ | ||
if ((data === undefined) || (data === null)) { | ||
return this.removeItem(key); | ||
} | ||
this.memoryStorage.set(key, data); | ||
/* Wrap in a RxJS `Observable` to be consistent with other storages */ | ||
@@ -173,2 +174,2 @@ return of(true); | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVtb3J5LWRhdGFiYXNlLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQG5neC1wd2EvbG9jYWwtc3RvcmFnZS8iLCJzb3VyY2VzIjpbImxpYi9kYXRhYmFzZXMvbWVtb3J5LWRhdGFiYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQzNDLE9BQU8sRUFBYyxFQUFFLEVBQUUsTUFBTSxNQUFNLENBQUM7O0FBSXRDO0lBQUE7Ozs7UUFRVSxrQkFBYSxHQUFHLElBQUksR0FBRyxFQUFlLENBQUM7S0FvR2hEO0lBL0ZDLHNCQUFJLGdDQUFJO1FBSFI7O1dBRUc7Ozs7O1FBQ0g7WUFFRSxzRUFBc0U7WUFDdEUsT0FBTyxFQUFFLENBQUMsSUFBSSxDQUFDL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3RyaW5nKTogT2JzZXJ2YWJsZTxib29sZWFuPiB7XG5cbiAgICAvKiBXcmFwIGluIGEgUnhKUyBgT2JzZXJ2YWJsZWAgdG8gYmUgY29uc2lzdGVudCB3aXRoIG90aGVyIHN0b3JhZ2VzICovXG4gICAgcmV0dXJuIG9mKHRoaXMubWVtb3J5U3RvcmFnZS5oYXMoa2V5KSk7XG5cbiAgfVxuXG59XG4iXX0= |
@@ -173,3 +173,3 @@ /** | ||
/** | ||
* Schema for the values of an array. | ||
* Schema for the values of an array, or array of schemas for a tuple. | ||
* @type {?} | ||
@@ -258,2 +258,2 @@ */ | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoianNvbi1zY2hlbWEuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Abmd4LXB3YS9sb2NhbC1zdG9yYWdlLyIsInNvdXJjZXMiOlsibGliL3ZhbGlkYXRpb24vanNvbi1zY2hlbWEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7QUFPQSx1Q0FZQzs7Ozs7O0lBUEMsaUNBQWdCOzs7OztJQUtoQixrQ0FBZ0I7Ozs7OztBQU9sQixzQ0EyQ0M7Ozs7OztJQXRDQyxnQ0FBZTs7Ozs7SUFLZixpQ0FBZTs7Ozs7SUFLZixnQ0FBZ0I7Ozs7OztJQU1oQixzQ0FBb0I7Ozs7O0lBS3BCLG1DQUFpQjs7Ozs7SUFLakIsNENBQTBCOzs7OztJQUsxQixtQ0FBaUI7Ozs7O0lBS2pCLDRDQUEwQjs7Ozs7O0FBTzVCLHVDQTJDQzs7Ozs7O0lBdENDLGlDQUFnQjs7Ozs7SUFLaEIsa0NBQWU7Ozs7O0lBS2YsaUNBQWdCOzs7Ozs7SUFNaEIsdUNBQW9COzs7OztJQUtwQixvQ0FBaUI7Ozs7O0lBS2pCLDZDQUEwQjs7Ozs7SUFLMUIsb0NBQWlCOzs7OztJQUtqQiw2Q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wZXJ0aWVzYCB0b28uXG4gICAqL1xuICByZXF1aXJlZD86IHN0cmluZ1tdO1xuXG59XG5cbi8qKlxuICogQGRlcHJlY2F0ZWQgRGVwcmVjYXRlZCBpbiBmYXZvciBvZiBgSlNPTlNjaGVtYU51bWJlcmAgb3IgYEpTT05TY2hlbWFJbnRlZ2VyYFxuICogQXZhaWxhYmxlIGZvciBiYWNrd2FyZC1jb21wYXRpYmlsaXR5IG9ubHksICoqZG8gbm90IHVzZSoqLlxuICogTWF5IGJlIHJlbW92ZWQgaW4gdjkuXG4gKi9cbmV4cG9ydCB0eXBlIEpTT05TY2hlbWFOdW1lcmljID0gSlNPTlNjaGVtYU51bWJlciB8IEpTT05TY2hlbWFJbnRlZ2VyO1xuXG4vKipcbiAqIFN1YnNldCBvZiB0aGUgSlNPTiBTY2hlbWEgc3RhbmRhcmQuXG4gKiBUeXBlcyBhcmUgZW5mb3JjZWQgdG8gdmFsaWRhdGUgZXZlcnl0aGluZzogZWFjaCB2YWx1ZSAqKm11c3QqKiBoYXZlIGEgYHR5cGVgLlxuICogQHNlZSBodHRwczovL2dpdGh1Yi5jb20vY3lyaWxsZXR1emkvYW5ndWxhci1hc3luYy1sb2NhbC1zdG9yYWdlL2Jsb2IvbWFzdGVyL2RvY3MvVkFMSURBVElPTi5tZFxuICovXG5leHBvcnQgdHlwZSBKU09OU2NoZW1hID0gSlNPTlNjaGVtYVN0cmluZyB8IEpTT05TY2hlbWFOdW1iZXIgfCBKU09OU2NoZW1hSW50ZWdlciB8IEpTT05TY2hlbWFCb29sZWFuIHwgSlNPTlNjaGVtYUFycmF5IHwgSlNPTlNjaGVtYU9iamVjdDtcbiJdfQ== |
@@ -54,2 +54,3 @@ /** | ||
* @param schema Schema describing the string | ||
* @returns If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -61,3 +62,3 @@ /** | ||
* @param {?} schema Schema describing the string | ||
* @return {?} | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -69,3 +70,3 @@ JSONValidator.prototype.validateString = /** | ||
* @param {?} schema Schema describing the string | ||
* @return {?} | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -105,2 +106,3 @@ function (data, schema) { | ||
* @param schema Schema describing the number or integer | ||
* @returns If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -112,3 +114,3 @@ /** | ||
* @param {?} schema Schema describing the number or integer | ||
* @return {?} | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -120,3 +122,3 @@ JSONValidator.prototype.validateNumber = /** | ||
* @param {?} schema Schema describing the number or integer | ||
* @return {?} | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -158,2 +160,3 @@ function (data, schema) { | ||
* @param schema Schema describing the boolean | ||
* @returns If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -165,3 +168,3 @@ /** | ||
* @param {?} schema Schema describing the boolean | ||
* @return {?} | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -173,3 +176,3 @@ JSONValidator.prototype.validateBoolean = /** | ||
* @param {?} schema Schema describing the boolean | ||
* @return {?} | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -189,2 +192,3 @@ function (data, schema) { | ||
* @param schema Schema describing the array | ||
* @returns If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -196,3 +200,3 @@ /** | ||
* @param {?} schema Schema describing the array | ||
* @return {?} | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -204,3 +208,3 @@ JSONValidator.prototype.validateArray = /** | ||
* @param {?} schema Schema describing the array | ||
* @return {?} | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -226,2 +230,6 @@ function (data, schema) { | ||
} | ||
/* Specific test for tuples */ | ||
if (Array.isArray(schema.items)) { | ||
return this.validateTuple(data, schema.items); | ||
} | ||
try { | ||
@@ -246,5 +254,38 @@ /* Validate all the values in array */ | ||
/** | ||
* Validate a tuple (array with fixed length and multiple types) | ||
* @param data Data to validate | ||
* @param schemas Schemas describing the tuple | ||
* @returns If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
/** | ||
* Validate a tuple (array with fixed length and multiple types) | ||
* @private | ||
* @param {?} data Data to validate | ||
* @param {?} schemas Schemas describing the tuple | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
JSONValidator.prototype.validateTuple = /** | ||
* Validate a tuple (array with fixed length and multiple types) | ||
* @private | ||
* @param {?} data Data to validate | ||
* @param {?} schemas Schemas describing the tuple | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
function (data, schemas) { | ||
/* Tuples have a fixed length */ | ||
if (data.length !== schemas.length) { | ||
return false; | ||
} | ||
for (var i = 0; i < schemas.length; i += 1) { | ||
if (!this.validate(data[i], schemas[i])) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
}; | ||
/** | ||
* Validate an object | ||
* @param data Data to validate | ||
* @param schema JSON schema describing the object | ||
* @returns If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -256,3 +297,3 @@ /** | ||
* @param {?} schema JSON schema describing the object | ||
* @return {?} | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -264,3 +305,3 @@ JSONValidator.prototype.validateObject = /** | ||
* @param {?} schema JSON schema describing the object | ||
* @return {?} | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -312,2 +353,3 @@ function (data, schema) { | ||
* @param schema JSON schema describing the constant | ||
* @returns If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -319,3 +361,3 @@ /** | ||
* @param {?} schema JSON schema describing the constant | ||
* @return {?} | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -327,3 +369,3 @@ JSONValidator.prototype.validateConst = /** | ||
* @param {?} schema JSON schema describing the constant | ||
* @return {?} | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -340,2 +382,3 @@ function (data, schema) { | ||
* @param schema JSON schema describing the enum | ||
* @returns If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -347,3 +390,3 @@ /** | ||
* @param {?} schema JSON schema describing the enum | ||
* @return {?} | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -355,3 +398,3 @@ JSONValidator.prototype.validateEnum = /** | ||
* @param {?} schema JSON schema describing the enum | ||
* @return {?} | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -374,2 +417,2 @@ function (data, schema) { | ||
export { JSONValidator }; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoianNvbi12YWxpZGF0b3IuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Abmd4LXB3YS9sb2NhbC1zdG9yYWdlLyIsInNvdXJjZXMiOlsibGliL3ZhbGlkYXRpb24vanNvbi12YWxpZGF0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDOztBQU0zQztJQUFBO0tBK1FDO0lBMVFDOzs7Ozs7O09BT0c7Ozs7Ozs7OztJQUNILGdDQUFROzs7Ozs7OztJQUFSLFVBQVMsSUFBUyxFQUFFLE1BQWtCO1FBRXBDLFFBQVEsTUFBTSxDQUFDLElBQUksRUFBRTtZQUVuQixLQUFLLFFBQVE7Z0JBQ1gsT0FBTyxJQUFJLENBQUMsY0FBYyxDQUFDLElBQUksRUFBRSxNQUFNLENBQUMsQ0FBQztZQUMzQyxLQUFLLFFBQVEsQ0FBQztZQUNkLEtBQUssU0FBUztnQkFDWixPQUFPLElBQUksQ0FBQyxjQUFjLENBQUMsSUFBSSxFQUFFLE1BQU0sQ0FBQyxDQUFDO1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ZhbGlkOiBgZmFsc2VgXG4gICAqL1xuICBwcml2YXRlIHZhbGlkYXRlQ29uc3QoZGF0YTogYW55LCBzY2hlbWE6IEpTT05TY2hlbWFCb29sZWFuIHwgSlNPTlNjaGVtYUludGVnZXIgfCBKU09OU2NoZW1hTnVtYmVyIHwgSlNPTlNjaGVtYVN0cmluZyk6IGJvb2xlYW4ge1xuXG4gICAgaWYgKCFzY2hlbWEuY29uc3QpIHtcbiAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cblxuICAgIHJldHVybiAoZGF0YSA9PT0gc2NoZW1hLmNvbnN0KTtcblxuICB9XG5cbiAgLyoqXG4gICAqIFZhbGlkYXRlIGFuIGVudW1cbiAgICogQHBhcmFtIGRhdGEgRGF0YSB0YSB2YWxpZGF0ZVxuICAgKiBAcGFyYW0gc2NoZW1hIEpTT04gc2NoZW1hIGRlc2NyaWJpbmcgdGhlIGVudW1cbiAgICogQHJldHVybnMgSWYgZGF0YSBpcyB2YWxpZDogYHRydWVgLCBpZiBpdCBpcyBpbnZhbGlkOiBgZmFsc2VgXG4gICAqL1xuICBwcml2YXRlIHZhbGlkYXRlRW51bShkYXRhOiBhbnksIHNjaGVtYTogSlNPTlNjaGVtYUludGVnZXIgfCBKU09OU2NoZW1hTnVtYmVyIHwgSlNPTlNjaGVtYVN0cmluZyk6IGJvb2xlYW4ge1xuXG4gICAgaWYgKCFzY2hlbWEuZW51bSkge1xuICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuXG4gICAgLyogQ2FzdCBhcyB0aGUgZGF0YSBjYW4gYmUgb2YgbXVsdGlwbGUgdHlwZXMsIGFuZCBzbyBUeXBlU2NyaXB0IGlzIGxvc3QgKi9cbiAgICByZXR1cm4gKChzY2hlbWEuZW51bSBhcyBhbnlbXSkuaW5jbHVkZXMoZGF0YSkpO1xuXG4gIH1cblxufVxuIl19 |
@@ -224,7 +224,5 @@ import { isPlatformBrowser, isPlatformWorkerApp, isPlatformWorkerUi } from '@angular/common'; | ||
setItem(key, data) { | ||
/* Storing `null` or `undefined` is known to cause issues in some browsers. | ||
* So it's useless, not storing anything in this case */ | ||
/* Storing `undefined` or `null` in `localStorage` can cause issues in some browsers so removing item instead */ | ||
if ((data === undefined) || (data === null)) { | ||
/* Trigger success */ | ||
return of(true); | ||
return this.removeItem(key); | ||
} | ||
@@ -677,21 +675,22 @@ /* Open a transaction in write mode */ | ||
setItem(key, data) { | ||
/* Storing `undefined` or `null` in `localStorage` can cause issues in some browsers and has no sense */ | ||
if ((data !== undefined) && (data !== null)) { | ||
/** @type {?} */ | ||
let serializedData = null; | ||
/* Try to stringify (can fail on circular references) */ | ||
try { | ||
serializedData = JSON.stringify(data); | ||
} | ||
catch (error) { | ||
return throwError((/** @type {?} */ (error))); | ||
} | ||
/* Can fail if storage quota is exceeded */ | ||
try { | ||
localStorage.setItem(this.prefixKey(key), serializedData); | ||
} | ||
catch (error) { | ||
return throwError((/** @type {?} */ (error))); | ||
} | ||
/* Storing `undefined` or `null` in `localStorage` can cause issues in some browsers so removing item instead */ | ||
if ((data === undefined) || (data === null)) { | ||
return this.removeItem(key); | ||
} | ||
/** @type {?} */ | ||
let serializedData = null; | ||
/* Try to stringify (can fail on circular references) */ | ||
try { | ||
serializedData = JSON.stringify(data); | ||
} | ||
catch (error) { | ||
return throwError((/** @type {?} */ (error))); | ||
} | ||
/* Can fail if storage quota is exceeded */ | ||
try { | ||
localStorage.setItem(this.prefixKey(key), serializedData); | ||
} | ||
catch (error) { | ||
return throwError((/** @type {?} */ (error))); | ||
} | ||
/* Wrap in a RxJS `Observable` to be consistent with other storages */ | ||
@@ -828,6 +827,7 @@ return of(true); | ||
setItem(key, data) { | ||
/* Storing `undefined` or `null` in `localStorage` is useless */ | ||
if ((data !== undefined) && (data !== null)) { | ||
this.memoryStorage.set(key, data); | ||
/* Storing `undefined` or `null` in `localStorage` is useless, so removing item instead */ | ||
if ((data === undefined) || (data === null)) { | ||
return this.removeItem(key); | ||
} | ||
this.memoryStorage.set(key, data); | ||
/* Wrap in a RxJS `Observable` to be consistent with other storages */ | ||
@@ -990,3 +990,3 @@ return of(true); | ||
* @param {?} schema Schema describing the string | ||
* @return {?} | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -1027,3 +1027,3 @@ validateString(data, schema) { | ||
* @param {?} schema Schema describing the number or integer | ||
* @return {?} | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -1066,3 +1066,3 @@ validateNumber(data, schema) { | ||
* @param {?} schema Schema describing the boolean | ||
* @return {?} | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -1083,3 +1083,3 @@ validateBoolean(data, schema) { | ||
* @param {?} schema Schema describing the array | ||
* @return {?} | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -1104,2 +1104,6 @@ validateArray(data, schema) { | ||
} | ||
/* Specific test for tuples */ | ||
if (Array.isArray(schema.items)) { | ||
return this.validateTuple(data, schema.items); | ||
} | ||
/* Validate all the values in array */ | ||
@@ -1114,2 +1118,21 @@ for (const value of data) { | ||
/** | ||
* Validate a tuple (array with fixed length and multiple types) | ||
* @private | ||
* @param {?} data Data to validate | ||
* @param {?} schemas Schemas describing the tuple | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
validateTuple(data, schemas) { | ||
/* Tuples have a fixed length */ | ||
if (data.length !== schemas.length) { | ||
return false; | ||
} | ||
for (let i = 0; i < schemas.length; i += 1) { | ||
if (!this.validate(data[i], schemas[i])) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
/** | ||
* Validate an object | ||
@@ -1119,3 +1142,3 @@ * @private | ||
* @param {?} schema JSON schema describing the object | ||
* @return {?} | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -1157,3 +1180,3 @@ validateObject(data, schema) { | ||
* @param {?} schema JSON schema describing the constant | ||
* @return {?} | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -1171,3 +1194,3 @@ validateConst(data, schema) { | ||
* @param {?} schema JSON schema describing the enum | ||
* @return {?} | ||
* @return {?} If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -1174,0 +1197,0 @@ validateEnum(data, schema) { |
@@ -131,5 +131,5 @@ /** | ||
/** | ||
* Schema for the values of an array. | ||
* Schema for the values of an array, or array of schemas for a tuple. | ||
*/ | ||
items: JSONSchema; | ||
items: JSONSchema | JSONSchema[]; | ||
/** | ||
@@ -136,0 +136,0 @@ * Check if an array length is lower or equal to this value. |
@@ -16,2 +16,3 @@ import { JSONSchema } from './json-schema'; | ||
* @param schema Schema describing the string | ||
* @returns If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -23,2 +24,3 @@ private validateString; | ||
* @param schema Schema describing the number or integer | ||
* @returns If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -30,2 +32,3 @@ private validateNumber; | ||
* @param schema Schema describing the boolean | ||
* @returns If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -37,8 +40,17 @@ private validateBoolean; | ||
* @param schema Schema describing the array | ||
* @returns If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
private validateArray; | ||
/** | ||
* Validate a tuple (array with fixed length and multiple types) | ||
* @param data Data to validate | ||
* @param schemas Schemas describing the tuple | ||
* @returns If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
private validateTuple; | ||
/** | ||
* Validate an object | ||
* @param data Data to validate | ||
* @param schema JSON schema describing the object | ||
* @returns If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -50,2 +62,3 @@ private validateObject; | ||
* @param schema JSON schema describing the constant | ||
* @returns If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
@@ -57,4 +70,5 @@ private validateConst; | ||
* @param schema JSON schema describing the enum | ||
* @returns If data is valid: `true`, if it is invalid: `false` | ||
*/ | ||
private validateEnum; | ||
} |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":4,"metadata":{"JSONSchema":{"__symbolic":"interface"},"JSONSchemaBoolean":{"__symbolic":"interface"},"JSONSchemaInteger":{"__symbolic":"interface"},"JSONSchemaNumber":{"__symbolic":"interface"},"JSONSchemaNumeric":{"__symbolic":"interface"},"JSONSchemaString":{"__symbolic":"interface"},"JSONSchemaArray":{"__symbolic":"interface"},"JSONSchemaArrayOf":{"__symbolic":"interface"},"JSONSchemaObject":{"__symbolic":"interface"},"ɵa":{"__symbolic":"function"},"LocalDatabase":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":65,"character":1},"arguments":[{"providedIn":"root","useFactory":{"__symbolic":"reference","name":"ɵa"},"deps":[{"__symbolic":"reference","module":"@angular/core","name":"PLATFORM_ID","line":69,"character":4},{"__symbolic":"reference","name":"ɵb"},{"__symbolic":"reference","name":"ɵc"},{"__symbolic":"reference","name":"ɵd"},{"__symbolic":"reference","name":"LOCAL_STORAGE_PREFIX"}]}]}],"members":{"getItem":[{"__symbolic":"method"}],"setItem":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"clear":[{"__symbolic":"method"}],"keys":[{"__symbolic":"method"}],"has":[{"__symbolic":"method"}]},"statics":{"ngInjectableDef":{}}},"LocalStorage":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":28,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":62,"character":5},"arguments":[{"__symbolic":"reference","name":"ɵb"}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":64,"character":5},"arguments":[{"__symbolic":"reference","name":"LOCAL_STORAGE_PREFIX"}]}]],"parameters":[{"__symbolic":"reference","name":"LocalDatabase"},{"__symbolic":"reference","name":"ɵe"},null,null]}],"getItem":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"setItem":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"clear":[{"__symbolic":"method"}],"keys":[{"__symbolic":"method"}],"has":[{"__symbolic":"method"}],"setItemSubscribe":[{"__symbolic":"method"}],"removeItemSubscribe":[{"__symbolic":"method"}],"clearSubscribe":[{"__symbolic":"method"}],"catchIDBBroken":[{"__symbolic":"method"}]},"statics":{"ngInjectableDef":{}}},"LSGetItemOptions":{"__symbolic":"interface"},"ɵb":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":14,"character":29},"arguments":["localStoragePrefix",{"__symbolic":"error","message":"Lambda not supported","line":16,"character":11,"module":"./lib/tokens"}]},"ɵc":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":27,"character":31},"arguments":["localStorageIDBDBName",{"__symbolic":"error","message":"Lambda not supported","line":29,"character":11,"module":"./lib/tokens"}]},"ɵd":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":47,"character":34},"arguments":["localStorageIDBStoreName",{"__symbolic":"error","message":"Lambda not supported","line":49,"character":11,"module":"./lib/tokens"}]},"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":[]},{"__symbolic":"if","condition":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"LSPrefix"},"thenExpression":{"provide":{"__symbolic":"reference","name":"ɵb"},"useValue":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"LSPrefix"}},"elseExpression":[]},{"__symbolic":"if","condition":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"IDBDBName"},"thenExpression":{"provide":{"__symbolic":"reference","name":"ɵc"},"useValue":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"IDBDBName"}},"elseExpression":[]},{"__symbolic":"if","condition":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"IDBStoreName"},"thenExpression":{"provide":{"__symbolic":"reference","name":"ɵd"},"useValue":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"IDBStoreName"}},"elseExpression":[]}]},"LocalStorageProvidersConfig":{"__symbolic":"interface"},"DEFAULT_IDB_DB_NAME":"ngStorage","DEFAULT_IDB_STORE_NAME":"storage","LOCAL_STORAGE_PREFIX":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":6,"character":40},"arguments":["localStoragePrefix",{"__symbolic":"error","message":"Lambda not supported","line":8,"character":11,"module":"./lib/tokens"}]},"VALIDATION_ERROR":"Data stored is not valid against the provided JSON schema.\nCheck your JSON schema, otherwise it means data has been corrupted.","ValidationError":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"Error"},"members":{}},"ɵe":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":6,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"validate":[{"__symbolic":"method"}],"validateString":[{"__symbolic":"method"}],"validateNumber":[{"__symbolic":"method"}],"validateBoolean":[{"__symbolic":"method"}],"validateArray":[{"__symbolic":"method"}],"validateObject":[{"__symbolic":"method"}],"validateConst":[{"__symbolic":"method"}],"validateEnum":[{"__symbolic":"method"}]},"statics":{"ngInjectableDef":{}}}},"origins":{"JSONSchema":"./lib/validation/json-schema","JSONSchemaBoolean":"./lib/validation/json-schema","JSONSchemaInteger":"./lib/validation/json-schema","JSONSchemaNumber":"./lib/validation/json-schema","JSONSchemaNumeric":"./lib/validation/json-schema","JSONSchemaString":"./lib/validation/json-schema","JSONSchemaArray":"./lib/validation/json-schema","JSONSchemaArrayOf":"./lib/validation/json-schema","JSONSchemaObject":"./lib/validation/json-schema","ɵa":"./lib/databases/local-database","LocalDatabase":"./lib/databases/local-database","LocalStorage":"./lib/lib.service","LSGetItemOptions":"./lib/lib.service","ɵb":"./lib/tokens","ɵc":"./lib/tokens","ɵd":"./lib/tokens","localStorageProviders":"./lib/tokens","LocalStorageProvidersConfig":"./lib/tokens","DEFAULT_IDB_DB_NAME":"./lib/tokens","DEFAULT_IDB_STORE_NAME":"./lib/tokens","LOCAL_STORAGE_PREFIX":"./lib/tokens","VALIDATION_ERROR":"./lib/exceptions","ValidationError":"./lib/exceptions","ɵe":"./lib/validation/json-validator"},"importAs":"@ngx-pwa/local-storage"} | ||
{"__symbolic":"module","version":4,"metadata":{"JSONSchema":{"__symbolic":"interface"},"JSONSchemaBoolean":{"__symbolic":"interface"},"JSONSchemaInteger":{"__symbolic":"interface"},"JSONSchemaNumber":{"__symbolic":"interface"},"JSONSchemaNumeric":{"__symbolic":"interface"},"JSONSchemaString":{"__symbolic":"interface"},"JSONSchemaArray":{"__symbolic":"interface"},"JSONSchemaArrayOf":{"__symbolic":"interface"},"JSONSchemaObject":{"__symbolic":"interface"},"ɵa":{"__symbolic":"function"},"LocalDatabase":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":65,"character":1},"arguments":[{"providedIn":"root","useFactory":{"__symbolic":"reference","name":"ɵa"},"deps":[{"__symbolic":"reference","module":"@angular/core","name":"PLATFORM_ID","line":69,"character":4},{"__symbolic":"reference","name":"ɵb"},{"__symbolic":"reference","name":"ɵc"},{"__symbolic":"reference","name":"ɵd"},{"__symbolic":"reference","name":"LOCAL_STORAGE_PREFIX"}]}]}],"members":{"getItem":[{"__symbolic":"method"}],"setItem":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"clear":[{"__symbolic":"method"}],"keys":[{"__symbolic":"method"}],"has":[{"__symbolic":"method"}]},"statics":{"ngInjectableDef":{}}},"LocalStorage":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":28,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":62,"character":5},"arguments":[{"__symbolic":"reference","name":"ɵb"}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":64,"character":5},"arguments":[{"__symbolic":"reference","name":"LOCAL_STORAGE_PREFIX"}]}]],"parameters":[{"__symbolic":"reference","name":"LocalDatabase"},{"__symbolic":"reference","name":"ɵe"},null,null]}],"getItem":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"setItem":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"clear":[{"__symbolic":"method"}],"keys":[{"__symbolic":"method"}],"has":[{"__symbolic":"method"}],"setItemSubscribe":[{"__symbolic":"method"}],"removeItemSubscribe":[{"__symbolic":"method"}],"clearSubscribe":[{"__symbolic":"method"}],"catchIDBBroken":[{"__symbolic":"method"}]},"statics":{"ngInjectableDef":{}}},"LSGetItemOptions":{"__symbolic":"interface"},"ɵb":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":14,"character":29},"arguments":["localStoragePrefix",{"__symbolic":"error","message":"Lambda not supported","line":16,"character":11,"module":"./lib/tokens"}]},"ɵc":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":27,"character":31},"arguments":["localStorageIDBDBName",{"__symbolic":"error","message":"Lambda not supported","line":29,"character":11,"module":"./lib/tokens"}]},"ɵd":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":47,"character":34},"arguments":["localStorageIDBStoreName",{"__symbolic":"error","message":"Lambda not supported","line":49,"character":11,"module":"./lib/tokens"}]},"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":[]},{"__symbolic":"if","condition":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"LSPrefix"},"thenExpression":{"provide":{"__symbolic":"reference","name":"ɵb"},"useValue":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"LSPrefix"}},"elseExpression":[]},{"__symbolic":"if","condition":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"IDBDBName"},"thenExpression":{"provide":{"__symbolic":"reference","name":"ɵc"},"useValue":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"IDBDBName"}},"elseExpression":[]},{"__symbolic":"if","condition":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"IDBStoreName"},"thenExpression":{"provide":{"__symbolic":"reference","name":"ɵd"},"useValue":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"IDBStoreName"}},"elseExpression":[]}]},"LocalStorageProvidersConfig":{"__symbolic":"interface"},"DEFAULT_IDB_DB_NAME":"ngStorage","DEFAULT_IDB_STORE_NAME":"storage","LOCAL_STORAGE_PREFIX":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":6,"character":40},"arguments":["localStoragePrefix",{"__symbolic":"error","message":"Lambda not supported","line":8,"character":11,"module":"./lib/tokens"}]},"VALIDATION_ERROR":"Data stored is not valid against the provided JSON schema.\nCheck your JSON schema, otherwise it means data has been corrupted.","ValidationError":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"Error"},"members":{}},"ɵe":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":6,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"validate":[{"__symbolic":"method"}],"validateString":[{"__symbolic":"method"}],"validateNumber":[{"__symbolic":"method"}],"validateBoolean":[{"__symbolic":"method"}],"validateArray":[{"__symbolic":"method"}],"validateTuple":[{"__symbolic":"method"}],"validateObject":[{"__symbolic":"method"}],"validateConst":[{"__symbolic":"method"}],"validateEnum":[{"__symbolic":"method"}]},"statics":{"ngInjectableDef":{}}}},"origins":{"JSONSchema":"./lib/validation/json-schema","JSONSchemaBoolean":"./lib/validation/json-schema","JSONSchemaInteger":"./lib/validation/json-schema","JSONSchemaNumber":"./lib/validation/json-schema","JSONSchemaNumeric":"./lib/validation/json-schema","JSONSchemaString":"./lib/validation/json-schema","JSONSchemaArray":"./lib/validation/json-schema","JSONSchemaArrayOf":"./lib/validation/json-schema","JSONSchemaObject":"./lib/validation/json-schema","ɵa":"./lib/databases/local-database","LocalDatabase":"./lib/databases/local-database","LocalStorage":"./lib/lib.service","LSGetItemOptions":"./lib/lib.service","ɵb":"./lib/tokens","ɵc":"./lib/tokens","ɵd":"./lib/tokens","localStorageProviders":"./lib/tokens","LocalStorageProvidersConfig":"./lib/tokens","DEFAULT_IDB_DB_NAME":"./lib/tokens","DEFAULT_IDB_STORE_NAME":"./lib/tokens","LOCAL_STORAGE_PREFIX":"./lib/tokens","VALIDATION_ERROR":"./lib/exceptions","ValidationError":"./lib/exceptions","ɵe":"./lib/validation/json-validator"},"importAs":"@ngx-pwa/local-storage"} |
{ | ||
"name": "@ngx-pwa/local-storage", | ||
"version": "8.0.0-beta.5", | ||
"version": "8.0.0-beta.6", | ||
"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.", | ||
@@ -5,0 +5,0 @@ "author": "Cyrille Tuzi", |
@@ -88,3 +88,7 @@ # Async local storage for Angular | ||
You can store any value, without worrying about stringifying. | ||
You can store any value, without worrying about serializing. But note that: | ||
- storing `null` or `undefined` can cause issues in some browsers, so the item will be removed instead, | ||
- you should stick to JSON data, ie. primitive types, arrays and literal objects. | ||
`Map`, `Set`, `Blob` and other special structures can cause issues in some scenarios. | ||
See the [serialization guide](./docs/SERIALIZATION.md) for more details. | ||
@@ -144,8 +148,6 @@ ### Deleting data | ||
You *DO NOT* need to unsubscribe: the observable autocompletes (like in the `HttpClient` service). | ||
You *DO NOT* need to unsubscribe: the `Observable` autocompletes (like in the `HttpClient` service). | ||
But you *DO* need to subscribe, even if you don't have something specific to do after writing in local storage (because it's how RxJS Observables work). | ||
Since *version 5.2*, you can use these methods to auto-subscribe: | ||
```typescript | ||
@@ -152,0 +154,0 @@ this.localStorage.setItemSubscribe('user', user); |
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 not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
982690
10855
240