Socket
Socket
Sign inDemoInstall

@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 5.3.0-beta.1 to 5.3.0

2

bundles/local-storage.umd.js

@@ -59,2 +59,3 @@ (function (global, factory) {

function IndexedDBDatabase(prefix) {
if (prefix === void 0) { prefix = null; }
var _this = _super.call(this) || this;

@@ -356,2 +357,3 @@ _this.prefix = prefix;

function LocalStorageDatabase(userPrefix) {
if (userPrefix === void 0) { userPrefix = null; }
var _this = _super.call(this) || this;

@@ -358,0 +360,0 @@ _this.userPrefix = userPrefix;

2

bundles/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/ReplaySubject"),require("rxjs/operators"),require("rxjs/observable/fromEvent"),require("rxjs/observable/of"),require("rxjs/observable/throw"),require("rxjs/observable/race"),require("@angular/common")):"function"==typeof define&&define.amd?define(["exports","@angular/core","rxjs/ReplaySubject","rxjs/operators","rxjs/observable/fromEvent","rxjs/observable/of","rxjs/observable/throw","rxjs/observable/race","@angular/common"],t):t((e.ngxPWA=e.ngxPWA||{},e.ngxPWA.localStorage=e.ngxPWA.localStorage||{}),e.ng.core,e.Rx,e.Rx.operators,e.Rx.Observable,e.Rx.Observable,e.Rx.Observable,e.Rx.Observable,e.ng.common)}(this,function(e,t,r,o,n,a,i,s,u){"use strict";function c(e,t){return u.isPlatformBrowser(e)&&"indexedDB"in window&&void 0!==indexedDB&&null!==indexedDB?new y(t):u.isPlatformBrowser(e)&&"localStorage"in window&&void 0!==localStorage&&null!==localStorage?new d(t):new h}var p=function(){return function(){}}(),l=new t.InjectionToken("localStoragePrefix"),f=function(){var e=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])};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),y=function(e){function u(t){var o=e.call(this)||this;return o.prefix=t,o.dbName="ngStorage",o.objectStoreName="localStorage",o.keyPath="key",o.dataPath="value",t&&(o.dbName=t+"_"+o.dbName),o.database=new r.ReplaySubject,o.connect(),o}return f(u,e),u.prototype.getItem=function(e){var t=this;return this.transaction().pipe(o.map(function(t){return t.get(e)}),o.mergeMap(function(e){var r=n.fromEvent(e,"success").pipe(o.map(function(e){return e.target.result}),o.map(function(e){return e&&t.dataPath in e?e[t.dataPath]:null}));return s.race(r,t.toErrorObservable(e,"getter")).pipe(o.first())}),o.first())},u.prototype.setItem=function(e,t){var r=this;return null==t?a.of(!0):this.getItem(e).pipe(o.map(function(e){return null==e?"add":"put"}),o.mergeMap(function(n){return r.transaction("readwrite").pipe(o.mergeMap(function(a){var i;switch(n){case"add":i=a.add((u={},u[r.dataPath]=t,u),e);break;case"put":default:i=a.put((c={},c[r.dataPath]=t,c),e)}return s.race(r.toSuccessObservable(i),r.toErrorObservable(i,"setter")).pipe(o.first());var u,c}))}),o.first())},u.prototype.removeItem=function(e){var t=this;return this.getItem(e).pipe(o.mergeMap(function(r){return null!=r?t.transaction("readwrite").pipe(o.mergeMap(function(r){var n=r.delete(e);return s.race(t.toSuccessObservable(n),t.toErrorObservable(n,"remover")).pipe(o.first())})):a.of(!0)}),o.first())},u.prototype.clear=function(){var e=this;return this.transaction("readwrite").pipe(o.mergeMap(function(t){var r=t.clear();return s.race(e.toSuccessObservable(r),e.toErrorObservable(r,"clearer")).pipe(o.first())}),o.first())},u.prototype.connect=function(){var e=this,t=indexedDB.open(this.dbName);n.fromEvent(t,"upgradeneeded").pipe(o.first()).subscribe(function(t){var r=t.target.result;r.objectStoreNames.contains(e.objectStoreName)||r.createObjectStore(e.objectStoreName)});var r=n.fromEvent(t,"success");s.race(r,this.toErrorObservable(t,"connection")).pipe(o.first()).subscribe(function(t){e.database.next(t.target.result)},function(t){e.database.error(t)})},u.prototype.transaction=function(e){var t=this;return void 0===e&&(e="readonly"),this.database.pipe(o.map(function(r){return r.transaction([t.objectStoreName],e).objectStore(t.objectStoreName)}))},u.prototype.toSuccessObservable=function(e){return n.fromEvent(e,"success").pipe(o.map(function(){return!0}))},u.prototype.toErrorObservable=function(e,t){return void 0===t&&(t=""),n.fromEvent(e,"error").pipe(o.mergeMap(function(r){return i._throw(new Error("IndexedDB "+t+" issue : "+e.error.message+"."))}))},u.decorators=[{type:t.Injectable}],u.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[l]}]}]},u}(p),b=function(){var e=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])};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),d=function(e){function r(t){var r=e.call(this)||this;return r.userPrefix=t,r.prefix="",t&&(r.prefix=t+"_"),r}return b(r,e),r.prototype.getItem=function(e){var t=localStorage.getItem(""+this.prefix+e),r=null;if(null!=t)try{r=JSON.parse(t)}catch(e){return i._throw(new Error("Invalid data in localStorage."))}return a.of(r)},r.prototype.setItem=function(e,t){return localStorage.setItem(""+this.prefix+e,JSON.stringify(t)),a.of(!0)},r.prototype.removeItem=function(e){return localStorage.removeItem(""+this.prefix+e),a.of(!0)},r.prototype.clear=function(){return localStorage.clear(),a.of(!0)},r.decorators=[{type:t.Injectable}],r.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[l]}]}]},r}(p),m=function(){var e=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])};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),h=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.localStorage=new Map,t}return m(r,e),r.prototype.getItem=function(e){var t=this.localStorage.get(e);return a.of(void 0!==t?t:null)},r.prototype.setItem=function(e,t){return this.localStorage.set(e,t),a.of(!0)},r.prototype.removeItem=function(e){return this.localStorage.delete(e),a.of(!0)},r.prototype.clear=function(){return this.localStorage.clear(),a.of(!0)},r.decorators=[{type:t.Injectable}],r.ctorParameters=function(){return[]},r}(p),v=function(){function e(){this.simpleTypes=["string","number","boolean","object"]}return e.prototype.isObjectNotNull=function(e){return null!==e&&"object"==typeof e},e.prototype.validate=function(e,t){if(!this.isObjectNotNull(t))throw new Error("A schema must be an object (unlike spec, booleans are not supported to enforce strict types).");if(!(t.hasOwnProperty("type")&&"array"!==t.type&&"object"!==t.type||t.hasOwnProperty("properties")||t.hasOwnProperty("items")))throw new Error("Each value must have a 'type' or 'properties' or 'items', to enforce strict types.");if(t.hasOwnProperty("type")&&!this.validateType(e,t))return!1;if(t.hasOwnProperty("items")&&!this.validateItems(e,t))return!1;if(t.hasOwnProperty("properties")){if(t.hasOwnProperty("required")&&!this.validateRequired(e,t))return!1;if(!this.validateProperties(e,t))return!1}return!0},e.prototype.validateProperties=function(e,t){if(!this.isObjectNotNull(e))return!1;if(!t.properties||!this.isObjectNotNull(t.properties))throw new Error("'properties' must be a schema object.");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){if(!this.isObjectNotNull(e))return!1;if(!Array.isArray(t.required))throw new Error("'required' field must be an array. Note that since JSON Schema draft 6, booleans are not supported anymore.");for(var r=0,o=t.required;r<o.length;r++){var n=o[r];if("string"!=typeof n)throw new Error("'required' array must contain strings only.");if(!t.properties||!t.properties.hasOwnProperty(n))throw new Error("'required' properties must be described in 'properties' too.");if(!e.hasOwnProperty(n))return!1}return!0},e.prototype.validateType=function(e,t){if(Array.isArray(t.type))return this.validateTypeList(e,t);if("string"!=typeof t.type)throw new Error("'type' must be a string (arrays of types are not supported yet).");return("null"!==t.type||null===e)&&((-1===this.simpleTypes.indexOf(t.type)||typeof e===t.type)&&!!("integer"!==t.type||"number"==typeof e&&Number.isInteger(e)))},e.prototype.validateTypeList=function(e,t){for(var r=[],o=0,n=t.type;o<n.length;o++){var a=n[o];r.push(this.validateType(e,{type:a}))}return-1!==r.indexOf(!0)},e.prototype.validateItems=function(e,t){if(!Array.isArray(e))return!1;if(Array.isArray(t.items))return this.validateItemsList(e,t);if(!t.items||!this.isObjectNotNull(t.items))throw new Error("'items' must be a schema object.");for(var r=0,o=e;r<o.length;r++){var n=o[r];if(!this.validate(n,t.items))return!1}return!0},e.prototype.validateItemsList=function(e,t){var r=t.items;if(e.length!==r.length)return!1;for(var o=0;o<r.length;o+=1)if(!this.validate(e[o],r[o]))return!1;return!0},e}(),g=function(){function e(e,t){this.database=e,this.jsonValidator=t,this.getItemOptionsDefault={schema:null}}return e.prototype.getItem=function(e,t){var r=this;return void 0===t&&(t=this.getItemOptionsDefault),this.database.getItem(e).pipe(o.mergeMap(function(e){if(t.schema&&null!==e){var o=!0;try{o=r.jsonValidator.validate(e,t.schema)}catch(e){return i._throw(e)}if(!o)return i._throw(new Error("JSON invalid"))}return a.of(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}],e.ctorParameters=function(){return[{type:p},{type:v}]},e}(),O=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{providers:[v,{provide:p,useFactory:c,deps:[t.PLATFORM_ID,[new t.Optional,l]]},g]}]}],e.ctorParameters=function(){return[]},e}();e.LocalDatabase=p,e.IndexedDBDatabase=y,e.LocalStorageDatabase=d,e.MockLocalDatabase=h,e.JSONValidator=v,e.LocalStorage=g,e.LocalStorageModule=O,e.localStorageProviders=function(e){return[e.prefix?{provide:l,useValue:e.prefix}:[]]},e.LOCAL_STORAGE_PREFIX=l,e.AsyncLocalStorage=g,e.AsyncLocalDatabase=p,e.AsyncLocalStorageModule=O,e.ɵa=c,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs/ReplaySubject"),require("rxjs/operators"),require("rxjs/observable/fromEvent"),require("rxjs/observable/of"),require("rxjs/observable/throw"),require("rxjs/observable/race"),require("@angular/common")):"function"==typeof define&&define.amd?define(["exports","@angular/core","rxjs/ReplaySubject","rxjs/operators","rxjs/observable/fromEvent","rxjs/observable/of","rxjs/observable/throw","rxjs/observable/race","@angular/common"],t):t((e.ngxPWA=e.ngxPWA||{},e.ngxPWA.localStorage=e.ngxPWA.localStorage||{}),e.ng.core,e.Rx,e.Rx.operators,e.Rx.Observable,e.Rx.Observable,e.Rx.Observable,e.Rx.Observable,e.ng.common)}(this,function(e,t,r,o,n,a,i,s,u){"use strict";function c(e,t){return u.isPlatformBrowser(e)&&"indexedDB"in window&&void 0!==indexedDB&&null!==indexedDB?new y(t):u.isPlatformBrowser(e)&&"localStorage"in window&&void 0!==localStorage&&null!==localStorage?new d(t):new h}var p=function(){return function(){}}(),l=new t.InjectionToken("localStoragePrefix"),f=function(){var e=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])};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),y=function(e){function u(t){void 0===t&&(t=null);var o=e.call(this)||this;return o.prefix=t,o.dbName="ngStorage",o.objectStoreName="localStorage",o.keyPath="key",o.dataPath="value",t&&(o.dbName=t+"_"+o.dbName),o.database=new r.ReplaySubject,o.connect(),o}return f(u,e),u.prototype.getItem=function(e){var t=this;return this.transaction().pipe(o.map(function(t){return t.get(e)}),o.mergeMap(function(e){var r=n.fromEvent(e,"success").pipe(o.map(function(e){return e.target.result}),o.map(function(e){return e&&t.dataPath in e?e[t.dataPath]:null}));return s.race(r,t.toErrorObservable(e,"getter")).pipe(o.first())}),o.first())},u.prototype.setItem=function(e,t){var r=this;return null==t?a.of(!0):this.getItem(e).pipe(o.map(function(e){return null==e?"add":"put"}),o.mergeMap(function(n){return r.transaction("readwrite").pipe(o.mergeMap(function(a){var i;switch(n){case"add":i=a.add((u={},u[r.dataPath]=t,u),e);break;case"put":default:i=a.put((c={},c[r.dataPath]=t,c),e)}return s.race(r.toSuccessObservable(i),r.toErrorObservable(i,"setter")).pipe(o.first());var u,c}))}),o.first())},u.prototype.removeItem=function(e){var t=this;return this.getItem(e).pipe(o.mergeMap(function(r){return null!=r?t.transaction("readwrite").pipe(o.mergeMap(function(r){var n=r.delete(e);return s.race(t.toSuccessObservable(n),t.toErrorObservable(n,"remover")).pipe(o.first())})):a.of(!0)}),o.first())},u.prototype.clear=function(){var e=this;return this.transaction("readwrite").pipe(o.mergeMap(function(t){var r=t.clear();return s.race(e.toSuccessObservable(r),e.toErrorObservable(r,"clearer")).pipe(o.first())}),o.first())},u.prototype.connect=function(){var e=this,t=indexedDB.open(this.dbName);n.fromEvent(t,"upgradeneeded").pipe(o.first()).subscribe(function(t){var r=t.target.result;r.objectStoreNames.contains(e.objectStoreName)||r.createObjectStore(e.objectStoreName)});var r=n.fromEvent(t,"success");s.race(r,this.toErrorObservable(t,"connection")).pipe(o.first()).subscribe(function(t){e.database.next(t.target.result)},function(t){e.database.error(t)})},u.prototype.transaction=function(e){var t=this;return void 0===e&&(e="readonly"),this.database.pipe(o.map(function(r){return r.transaction([t.objectStoreName],e).objectStore(t.objectStoreName)}))},u.prototype.toSuccessObservable=function(e){return n.fromEvent(e,"success").pipe(o.map(function(){return!0}))},u.prototype.toErrorObservable=function(e,t){return void 0===t&&(t=""),n.fromEvent(e,"error").pipe(o.mergeMap(function(r){return i._throw(new Error("IndexedDB "+t+" issue : "+e.error.message+"."))}))},u.decorators=[{type:t.Injectable}],u.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[l]}]}]},u}(p),b=function(){var e=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])};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),d=function(e){function r(t){void 0===t&&(t=null);var r=e.call(this)||this;return r.userPrefix=t,r.prefix="",t&&(r.prefix=t+"_"),r}return b(r,e),r.prototype.getItem=function(e){var t=localStorage.getItem(""+this.prefix+e),r=null;if(null!=t)try{r=JSON.parse(t)}catch(e){return i._throw(new Error("Invalid data in localStorage."))}return a.of(r)},r.prototype.setItem=function(e,t){return localStorage.setItem(""+this.prefix+e,JSON.stringify(t)),a.of(!0)},r.prototype.removeItem=function(e){return localStorage.removeItem(""+this.prefix+e),a.of(!0)},r.prototype.clear=function(){return localStorage.clear(),a.of(!0)},r.decorators=[{type:t.Injectable}],r.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[l]}]}]},r}(p),m=function(){var e=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])};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),h=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.localStorage=new Map,t}return m(r,e),r.prototype.getItem=function(e){var t=this.localStorage.get(e);return a.of(void 0!==t?t:null)},r.prototype.setItem=function(e,t){return this.localStorage.set(e,t),a.of(!0)},r.prototype.removeItem=function(e){return this.localStorage.delete(e),a.of(!0)},r.prototype.clear=function(){return this.localStorage.clear(),a.of(!0)},r.decorators=[{type:t.Injectable}],r.ctorParameters=function(){return[]},r}(p),v=function(){function e(){this.simpleTypes=["string","number","boolean","object"]}return e.prototype.isObjectNotNull=function(e){return null!==e&&"object"==typeof e},e.prototype.validate=function(e,t){if(!this.isObjectNotNull(t))throw new Error("A schema must be an object (unlike spec, booleans are not supported to enforce strict types).");if(!(t.hasOwnProperty("type")&&"array"!==t.type&&"object"!==t.type||t.hasOwnProperty("properties")||t.hasOwnProperty("items")))throw new Error("Each value must have a 'type' or 'properties' or 'items', to enforce strict types.");if(t.hasOwnProperty("type")&&!this.validateType(e,t))return!1;if(t.hasOwnProperty("items")&&!this.validateItems(e,t))return!1;if(t.hasOwnProperty("properties")){if(t.hasOwnProperty("required")&&!this.validateRequired(e,t))return!1;if(!this.validateProperties(e,t))return!1}return!0},e.prototype.validateProperties=function(e,t){if(!this.isObjectNotNull(e))return!1;if(!t.properties||!this.isObjectNotNull(t.properties))throw new Error("'properties' must be a schema object.");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){if(!this.isObjectNotNull(e))return!1;if(!Array.isArray(t.required))throw new Error("'required' field must be an array. Note that since JSON Schema draft 6, booleans are not supported anymore.");for(var r=0,o=t.required;r<o.length;r++){var n=o[r];if("string"!=typeof n)throw new Error("'required' array must contain strings only.");if(!t.properties||!t.properties.hasOwnProperty(n))throw new Error("'required' properties must be described in 'properties' too.");if(!e.hasOwnProperty(n))return!1}return!0},e.prototype.validateType=function(e,t){if(Array.isArray(t.type))return this.validateTypeList(e,t);if("string"!=typeof t.type)throw new Error("'type' must be a string (arrays of types are not supported yet).");return("null"!==t.type||null===e)&&((-1===this.simpleTypes.indexOf(t.type)||typeof e===t.type)&&!!("integer"!==t.type||"number"==typeof e&&Number.isInteger(e)))},e.prototype.validateTypeList=function(e,t){for(var r=[],o=0,n=t.type;o<n.length;o++){var a=n[o];r.push(this.validateType(e,{type:a}))}return-1!==r.indexOf(!0)},e.prototype.validateItems=function(e,t){if(!Array.isArray(e))return!1;if(Array.isArray(t.items))return this.validateItemsList(e,t);if(!t.items||!this.isObjectNotNull(t.items))throw new Error("'items' must be a schema object.");for(var r=0,o=e;r<o.length;r++){var n=o[r];if(!this.validate(n,t.items))return!1}return!0},e.prototype.validateItemsList=function(e,t){var r=t.items;if(e.length!==r.length)return!1;for(var o=0;o<r.length;o+=1)if(!this.validate(e[o],r[o]))return!1;return!0},e}(),g=function(){function e(e,t){this.database=e,this.jsonValidator=t,this.getItemOptionsDefault={schema:null}}return e.prototype.getItem=function(e,t){var r=this;return void 0===t&&(t=this.getItemOptionsDefault),this.database.getItem(e).pipe(o.mergeMap(function(e){if(t.schema&&null!==e){var o=!0;try{o=r.jsonValidator.validate(e,t.schema)}catch(e){return i._throw(e)}if(!o)return i._throw(new Error("JSON invalid"))}return a.of(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}],e.ctorParameters=function(){return[{type:p},{type:v}]},e}(),O=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{providers:[v,{provide:p,useFactory:c,deps:[t.PLATFORM_ID,[new t.Optional,l]]},g]}]}],e.ctorParameters=function(){return[]},e}();e.LocalDatabase=p,e.IndexedDBDatabase=y,e.LocalStorageDatabase=d,e.MockLocalDatabase=h,e.JSONValidator=v,e.LocalStorage=g,e.LocalStorageModule=O,e.localStorageProviders=function(e){return[e.prefix?{provide:l,useValue:e.prefix}:[]]},e.LOCAL_STORAGE_PREFIX=l,e.AsyncLocalStorage=g,e.AsyncLocalDatabase=p,e.AsyncLocalStorageModule=O,e.ɵa=c,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=local-storage.umd.min.js.map

@@ -62,2 +62,3 @@ import { Inject, Injectable, InjectionToken, NgModule, Optional, PLATFORM_ID } from '@angular/core';

function IndexedDBDatabase(prefix) {
if (prefix === void 0) { prefix = null; }
var _this = _super.call(this) || this;

@@ -359,2 +360,3 @@ _this.prefix = prefix;

function LocalStorageDatabase(userPrefix) {
if (userPrefix === void 0) { userPrefix = null; }
var _this = _super.call(this) || this;

@@ -361,0 +363,0 @@ _this.userPrefix = userPrefix;

@@ -46,5 +46,5 @@ import { Inject, Injectable, InjectionToken, NgModule, Optional, PLATFORM_ID } from '@angular/core';

* Connects to IndexedDB
* @param {?} prefix
* @param {?=} prefix
*/
constructor(prefix) {
constructor(prefix = null) {
super();

@@ -238,5 +238,5 @@ this.prefix = prefix;

/**
* @param {?} userPrefix
* @param {?=} userPrefix
*/
constructor(userPrefix) {
constructor(userPrefix = null) {
super();

@@ -243,0 +243,0 @@ this.userPrefix = userPrefix;

{
"name": "@ngx-pwa/local-storage",
"version": "5.3.0-beta.1",
"version": "5.3.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.",

@@ -60,3 +60,3 @@ "main": "./bundles/local-storage.umd.js",

"reinstall": "rimraf node_modules && npm install",
"publish": "npm publish dist --tag beta --access public"
"publish": "npm publish dist --tag lts5 --access public"
},

@@ -63,0 +63,0 @@ "dependencies": {},

@@ -157,6 +157,5 @@ # Async local storage for Angular

Note: last draft of JSON Schema is used (draft 7 at this time),
but we don't support all validation features yet. Just follow the interface.
Contributions are welcome to add more features.
but we don't support all validation features. Just follow the interface or see [#18](https://github.com/cyrilletuzi/angular-async-local-storage/issues/18) for the full list.
Note: as the goal is validation, types are enforced: each value MUST have either `type` or `properties` or `items`.
Note: as the goal is validation, types are enforced: each value MUST have either `type` or `properties` or `items` or `const` or `enum`.

@@ -163,0 +162,0 @@ ### Subscription

@@ -30,3 +30,3 @@ import { Observable } from 'rxjs/Observable';

*/
constructor(prefix: string | null);
constructor(prefix?: string | null);
/**

@@ -33,0 +33,0 @@ * Gets an item value in local storage

@@ -9,3 +9,3 @@ import { Observable } from 'rxjs/Observable';

*/
constructor(userPrefix: string | null);
constructor(userPrefix?: string | null);
/**

@@ -12,0 +12,0 @@ * Gets an item value in local storage

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 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