@ngx-pwa/local-storage
Advanced tools
Comparing version 5.3.5 to 5.3.6
@@ -24,2 +24,6 @@ (function (global, factory) { | ||
*/ | ||
/** | ||
* Avoid using this directly, use `localStorageProviders()` for configuration. | ||
* It will be removed in v8. | ||
*/ | ||
var LOCAL_STORAGE_PREFIX = new _angular_core.InjectionToken('localStoragePrefix'); | ||
@@ -112,11 +116,3 @@ /** | ||
/* Listening to the success event, and passing the item value if found, null otherwise */ | ||
var /** @type {?} */ success = (/** @type {?} */ (rxjs_observable_fromEvent.fromEvent(request, 'success'))).pipe(rxjs_operators.map(function (event) { return (/** @type {?} */ (event.target)).result; }), rxjs_operators.map(function (result) { | ||
if ((result != null) && (typeof result === 'object') && (_this.dataPath in result)) { | ||
return (/** @type {?} */ (result[_this.dataPath])); | ||
} | ||
else if ((result != null)) { | ||
return /** @type {?} */ (result); | ||
} | ||
return null; | ||
})); | ||
var /** @type {?} */ success = (/** @type {?} */ (rxjs_observable_fromEvent.fromEvent(request, 'success'))).pipe(rxjs_operators.map(function (event) { return (/** @type {?} */ (event.target)).result; }), rxjs_operators.map(function (result) { return (result && (_this.dataPath in result)) ? (/** @type {?} */ (result[_this.dataPath])) : null; })); | ||
/* Merging success and errors events and autoclosing the observable */ | ||
@@ -155,3 +151,3 @@ return (/** @type {?} */ (rxjs_observable_race.race(success, _this.toErrorObservable(request, "getter")))) | ||
return transaction$.pipe(rxjs_operators.tap(function (value) { | ||
transaction = /** @type {?} */ (value); | ||
transaction = value; | ||
}), /* Check if the key already exists or not | ||
@@ -161,3 +157,3 @@ * `getKey()` is only supported in indexedDb v2 (Chrome >= 58) | ||
* if `undefined` was stored by something else (native API or another lib) */ | ||
rxjs_operators.map(function () { return ('getKey' in transaction) ? transaction.getKey(key) : transaction.get(key); }), rxjs_operators.mergeMap(function (request) { | ||
rxjs_operators.map(function () { return transaction.get(key); }), rxjs_operators.mergeMap(function (request) { | ||
/* Listening to the success event, and passing the item value if found, null otherwise */ | ||
@@ -168,5 +164,5 @@ var /** @type {?} */ success = (/** @type {?} */ (rxjs_observable_fromEvent.fromEvent(request, 'success'))).pipe(rxjs_operators.map(function (event) { return (/** @type {?} */ (event.target)).result; })); | ||
.pipe(rxjs_operators.first()); | ||
}), rxjs_operators.mergeMap(function (existingKeyOrValue) { | ||
}), rxjs_operators.mergeMap(function (existingValue) { | ||
/* Adding or updating local storage, based on previous checking */ | ||
var /** @type {?} */ request = (existingKeyOrValue === undefined) ? | ||
var /** @type {?} */ request = (existingValue === undefined) ? | ||
transaction.add((_a = {}, _a[_this.dataPath] = data, _a), key) : | ||
@@ -173,0 +169,0 @@ transaction.put((_b = {}, _b[_this.dataPath] = data, _b), key); |
@@ -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 m}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 null!=e&&"object"==typeof e&&t.dataPath in e?e[t.dataPath]:null!=e?e:null}));return s.race(r,t.toErrorObservable(e,"getter")).pipe(o.first())}),o.first())},u.prototype.setItem=function(e,t){var r=this;if(null==t)return a.of(!0);var i;return this.transaction("readwrite").pipe(o.tap(function(e){i=e}),o.map(function(){return"getKey"in i?i.getKey(e):i.get(e)}),o.mergeMap(function(e){var t=n.fromEvent(e,"success").pipe(o.map(function(e){return e.target.result}));return s.race(t,r.toErrorObservable(e,"setter")).pipe(o.first())}),o.mergeMap(function(n){var a=void 0===n?i.add((u={},u[r.dataPath]=t,u),e):i.put((c={},c[r.dataPath]=t,c),e);return s.race(r.toSuccessObservable(a),r.toErrorObservable(a,"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 void 0!==t&&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),v=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)}}(),m=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.localStorage=new Map,t}return v(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),h=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:h}]},e}(),O=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{providers:[h,{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=m,e.JSONValidator=h,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 m}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;if(null==t)return a.of(!0);var i;return this.transaction("readwrite").pipe(o.tap(function(e){i=e}),o.map(function(){return i.get(e)}),o.mergeMap(function(e){var t=n.fromEvent(e,"success").pipe(o.map(function(e){return e.target.result}));return s.race(t,r.toErrorObservable(e,"setter")).pipe(o.first())}),o.mergeMap(function(n){var a=void 0===n?i.add((u={},u[r.dataPath]=t,u),e):i.put((c={},c[r.dataPath]=t,c),e);return s.race(r.toSuccessObservable(a),r.toErrorObservable(a,"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 void 0!==t&&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),v=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)}}(),m=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.localStorage=new Map,t}return v(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),h=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:h}]},e}(),O=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{providers:[h,{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=m,e.JSONValidator=h,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 |
@@ -27,2 +27,6 @@ import { Inject, Injectable, InjectionToken, NgModule, Optional, PLATFORM_ID } from '@angular/core'; | ||
*/ | ||
/** | ||
* Avoid using this directly, use `localStorageProviders()` for configuration. | ||
* It will be removed in v8. | ||
*/ | ||
var LOCAL_STORAGE_PREFIX = new InjectionToken('localStoragePrefix'); | ||
@@ -115,11 +119,3 @@ /** | ||
/* Listening to the success event, and passing the item value if found, null otherwise */ | ||
var /** @type {?} */ success = (/** @type {?} */ (fromEvent(request, 'success'))).pipe(map(function (event) { return (/** @type {?} */ (event.target)).result; }), map(function (result) { | ||
if ((result != null) && (typeof result === 'object') && (_this.dataPath in result)) { | ||
return (/** @type {?} */ (result[_this.dataPath])); | ||
} | ||
else if ((result != null)) { | ||
return /** @type {?} */ (result); | ||
} | ||
return null; | ||
})); | ||
var /** @type {?} */ success = (/** @type {?} */ (fromEvent(request, 'success'))).pipe(map(function (event) { return (/** @type {?} */ (event.target)).result; }), map(function (result) { return (result && (_this.dataPath in result)) ? (/** @type {?} */ (result[_this.dataPath])) : null; })); | ||
/* Merging success and errors events and autoclosing the observable */ | ||
@@ -158,3 +154,3 @@ return (/** @type {?} */ (race(success, _this.toErrorObservable(request, "getter")))) | ||
return transaction$.pipe(tap(function (value) { | ||
transaction = /** @type {?} */ (value); | ||
transaction = value; | ||
}), /* Check if the key already exists or not | ||
@@ -164,3 +160,3 @@ * `getKey()` is only supported in indexedDb v2 (Chrome >= 58) | ||
* if `undefined` was stored by something else (native API or another lib) */ | ||
map(function () { return ('getKey' in transaction) ? transaction.getKey(key) : transaction.get(key); }), mergeMap(function (request) { | ||
map(function () { return transaction.get(key); }), mergeMap(function (request) { | ||
/* Listening to the success event, and passing the item value if found, null otherwise */ | ||
@@ -171,5 +167,5 @@ var /** @type {?} */ success = (/** @type {?} */ (fromEvent(request, 'success'))).pipe(map(function (event) { return (/** @type {?} */ (event.target)).result; })); | ||
.pipe(first()); | ||
}), mergeMap(function (existingKeyOrValue) { | ||
}), mergeMap(function (existingValue) { | ||
/* Adding or updating local storage, based on previous checking */ | ||
var /** @type {?} */ request = (existingKeyOrValue === undefined) ? | ||
var /** @type {?} */ request = (existingValue === undefined) ? | ||
transaction.add((_a = {}, _a[_this.dataPath] = data, _a), key) : | ||
@@ -176,0 +172,0 @@ transaction.put((_b = {}, _b[_this.dataPath] = data, _b), key); |
@@ -24,2 +24,6 @@ import { Inject, Injectable, InjectionToken, NgModule, Optional, PLATFORM_ID } from '@angular/core'; | ||
*/ | ||
/** | ||
* Avoid using this directly, use `localStorageProviders()` for configuration. | ||
* It will be removed in v8. | ||
*/ | ||
const LOCAL_STORAGE_PREFIX = new InjectionToken('localStoragePrefix'); | ||
@@ -86,11 +90,3 @@ /** | ||
/* Listening to the success event, and passing the item value if found, null otherwise */ | ||
const /** @type {?} */ success = (/** @type {?} */ (fromEvent(request, 'success'))).pipe(map((event) => (/** @type {?} */ (event.target)).result), map((result) => { | ||
if ((result != null) && (typeof result === 'object') && (this.dataPath in result)) { | ||
return (/** @type {?} */ (result[this.dataPath])); | ||
} | ||
else if ((result != null)) { | ||
return /** @type {?} */ (result); | ||
} | ||
return null; | ||
})); | ||
const /** @type {?} */ success = (/** @type {?} */ (fromEvent(request, 'success'))).pipe(map((event) => (/** @type {?} */ (event.target)).result), map((result) => (result && (this.dataPath in result)) ? (/** @type {?} */ (result[this.dataPath])) : null)); | ||
/* Merging success and errors events and autoclosing the observable */ | ||
@@ -116,3 +112,3 @@ return (/** @type {?} */ (race(success, this.toErrorObservable(request, `getter`)))) | ||
return transaction$.pipe(tap((value) => { | ||
transaction = /** @type {?} */ (value); | ||
transaction = value; | ||
}), /* Check if the key already exists or not | ||
@@ -122,3 +118,3 @@ * `getKey()` is only supported in indexedDb v2 (Chrome >= 58) | ||
* if `undefined` was stored by something else (native API or another lib) */ | ||
map(() => ('getKey' in transaction) ? transaction.getKey(key) : transaction.get(key)), mergeMap((request) => { | ||
map(() => transaction.get(key)), mergeMap((request) => { | ||
/* Listening to the success event, and passing the item value if found, null otherwise */ | ||
@@ -129,5 +125,5 @@ const /** @type {?} */ success = (/** @type {?} */ (fromEvent(request, 'success'))).pipe(map((event) => (/** @type {?} */ (event.target)).result)); | ||
.pipe(first()); | ||
}), mergeMap((existingKeyOrValue) => { | ||
}), mergeMap((existingValue) => { | ||
/* Adding or updating local storage, based on previous checking */ | ||
const /** @type {?} */ request = (existingKeyOrValue === undefined) ? | ||
const /** @type {?} */ request = (existingValue === undefined) ? | ||
transaction.add({ [this.dataPath]: data }, key) : | ||
@@ -134,0 +130,0 @@ transaction.put({ [this.dataPath]: data }, key); |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":4,"metadata":{"JSONSchema":{"__symbolic":"interface"},"JSONSchemaType":{"__symbolic":"interface"},"LocalDatabase":{"__symbolic":"class","members":{"getItem":[{"__symbolic":"method"}],"setItem":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"clear":[{"__symbolic":"method"}]}},"IndexedDBDatabase":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"AsyncLocalDatabase"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":17,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":45,"character":15}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":45,"character":27},"arguments":[{"__symbolic":"reference","name":"LOCAL_STORAGE_PREFIX"}]}]],"parameters":[{"__symbolic":"reference","name":"string"}]}],"getItem":[{"__symbolic":"method"}],"setItem":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"clear":[{"__symbolic":"method"}],"connect":[{"__symbolic":"method"}],"transaction":[{"__symbolic":"method"}],"toSuccessObservable":[{"__symbolic":"method"}],"toErrorObservable":[{"__symbolic":"method"}]}},"LocalStorageDatabase":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"AsyncLocalDatabase"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":9,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":17,"character":15}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":17,"character":27},"arguments":[{"__symbolic":"reference","name":"LOCAL_STORAGE_PREFIX"}]}]],"parameters":[{"__symbolic":"reference","name":"string"}]}],"getItem":[{"__symbolic":"method"}],"setItem":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"clear":[{"__symbolic":"method"}]}},"MockLocalDatabase":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"AsyncLocalDatabase"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":7,"character":1}}],"members":{"getItem":[{"__symbolic":"method"}],"setItem":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"clear":[{"__symbolic":"method"}]}},"JSONValidator":{"__symbolic":"class","members":{"isObjectNotNull":[{"__symbolic":"method"}],"validate":[{"__symbolic":"method"}],"validateProperties":[{"__symbolic":"method"}],"validateRequired":[{"__symbolic":"method"}],"validateType":[{"__symbolic":"method"}],"validateTypeList":[{"__symbolic":"method"}],"validateItems":[{"__symbolic":"method"}],"validateItemsList":[{"__symbolic":"method"}]}},"LSGetItemOptions":{"__symbolic":"interface"},"LocalStorage":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":14,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"AsyncLocalDatabase"},{"__symbolic":"reference","name":"JSONValidator"}]}],"getItem":[{"__symbolic":"method"}],"setItem":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"clear":[{"__symbolic":"method"}],"setItemSubscribe":[{"__symbolic":"method"}],"removeItemSubscribe":[{"__symbolic":"method"}],"clearSubscribe":[{"__symbolic":"method"}]}},"ɵa":{"__symbolic":"function"},"LocalStorageModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":32,"character":1},"arguments":[{"providers":[{"__symbolic":"reference","name":"JSONValidator"},{"provide":{"__symbolic":"reference","name":"AsyncLocalDatabase"},"useFactory":{"__symbolic":"reference","name":"ɵa"},"deps":[{"__symbolic":"reference","module":"@angular/core","name":"PLATFORM_ID","line":38,"character":13},[{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":38,"character":31}},{"__symbolic":"reference","name":"LOCAL_STORAGE_PREFIX"}]]},{"__symbolic":"reference","name":"AsyncLocalStorage"}]}]}],"members":{}},"localStorageProviders":{"__symbolic":"function","parameters":["config"],"value":[{"__symbolic":"if","condition":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"prefix"},"thenExpression":{"provide":{"__symbolic":"reference","name":"LOCAL_STORAGE_PREFIX"},"useValue":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"prefix"}},"elseExpression":[]}]},"LocalStorageProvidersConfig":{"__symbolic":"interface"},"LOCAL_STORAGE_PREFIX":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":2,"character":40},"arguments":["localStoragePrefix"]},"AsyncLocalStorage":{"__symbolic":"reference","name":"LocalStorage"},"ALSGetItemOptions":{"__symbolic":"reference","name":"LSGetItemOptions"},"AsyncLocalDatabase":{"__symbolic":"reference","name":"LocalDatabase"},"AsyncLocalStorageModule":{"__symbolic":"reference","name":"LocalStorageModule"}},"origins":{"JSONSchema":"./src/service/validation/json-schema","JSONSchemaType":"./src/service/validation/json-schema","LocalDatabase":"./src/service/databases/local-database","IndexedDBDatabase":"./src/service/databases/indexeddb-database","LocalStorageDatabase":"./src/service/databases/localstorage-database","MockLocalDatabase":"./src/service/databases/mock-local-database","JSONValidator":"./src/service/validation/json-validator","LSGetItemOptions":"./src/service/lib.service","LocalStorage":"./src/service/lib.service","ɵa":"./src/module","LocalStorageModule":"./src/module","localStorageProviders":"./src/tokens","LocalStorageProvidersConfig":"./src/tokens","LOCAL_STORAGE_PREFIX":"./src/tokens","AsyncLocalStorage":"./src/service/lib.service","ALSGetItemOptions":"./src/service/lib.service","AsyncLocalDatabase":"./src/service/databases/local-database","AsyncLocalStorageModule":"./src/module"},"importAs":"@ngx-pwa/local-storage"} | ||
{"__symbolic":"module","version":4,"metadata":{"JSONSchema":{"__symbolic":"interface"},"JSONSchemaType":{"__symbolic":"interface"},"LocalDatabase":{"__symbolic":"class","members":{"getItem":[{"__symbolic":"method"}],"setItem":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"clear":[{"__symbolic":"method"}]}},"IndexedDBDatabase":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"AsyncLocalDatabase"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":13,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":41,"character":15}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":41,"character":27},"arguments":[{"__symbolic":"reference","name":"LOCAL_STORAGE_PREFIX"}]}]],"parameters":[{"__symbolic":"reference","name":"string"}]}],"getItem":[{"__symbolic":"method"}],"setItem":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"clear":[{"__symbolic":"method"}],"connect":[{"__symbolic":"method"}],"transaction":[{"__symbolic":"method"}],"toSuccessObservable":[{"__symbolic":"method"}],"toErrorObservable":[{"__symbolic":"method"}]}},"LocalStorageDatabase":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"AsyncLocalDatabase"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":9,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":17,"character":15}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":17,"character":27},"arguments":[{"__symbolic":"reference","name":"LOCAL_STORAGE_PREFIX"}]}]],"parameters":[{"__symbolic":"reference","name":"string"}]}],"getItem":[{"__symbolic":"method"}],"setItem":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"clear":[{"__symbolic":"method"}]}},"MockLocalDatabase":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"AsyncLocalDatabase"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":7,"character":1}}],"members":{"getItem":[{"__symbolic":"method"}],"setItem":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"clear":[{"__symbolic":"method"}]}},"JSONValidator":{"__symbolic":"class","members":{"isObjectNotNull":[{"__symbolic":"method"}],"validate":[{"__symbolic":"method"}],"validateProperties":[{"__symbolic":"method"}],"validateRequired":[{"__symbolic":"method"}],"validateType":[{"__symbolic":"method"}],"validateTypeList":[{"__symbolic":"method"}],"validateItems":[{"__symbolic":"method"}],"validateItemsList":[{"__symbolic":"method"}]}},"LSGetItemOptions":{"__symbolic":"interface"},"LocalStorage":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":14,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"AsyncLocalDatabase"},{"__symbolic":"reference","name":"JSONValidator"}]}],"getItem":[{"__symbolic":"method"}],"setItem":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"clear":[{"__symbolic":"method"}],"setItemSubscribe":[{"__symbolic":"method"}],"removeItemSubscribe":[{"__symbolic":"method"}],"clearSubscribe":[{"__symbolic":"method"}]}},"ɵa":{"__symbolic":"function"},"LocalStorageModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":32,"character":1},"arguments":[{"providers":[{"__symbolic":"reference","name":"JSONValidator"},{"provide":{"__symbolic":"reference","name":"AsyncLocalDatabase"},"useFactory":{"__symbolic":"reference","name":"ɵa"},"deps":[{"__symbolic":"reference","module":"@angular/core","name":"PLATFORM_ID","line":38,"character":13},[{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":38,"character":31}},{"__symbolic":"reference","name":"LOCAL_STORAGE_PREFIX"}]]},{"__symbolic":"reference","name":"AsyncLocalStorage"}]}]}],"members":{}},"localStorageProviders":{"__symbolic":"function","parameters":["config"],"value":[{"__symbolic":"if","condition":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"prefix"},"thenExpression":{"provide":{"__symbolic":"reference","name":"LOCAL_STORAGE_PREFIX"},"useValue":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"prefix"}},"elseExpression":[]}]},"LocalStorageProvidersConfig":{"__symbolic":"interface"},"LOCAL_STORAGE_PREFIX":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":6,"character":40},"arguments":["localStoragePrefix"]},"AsyncLocalStorage":{"__symbolic":"reference","name":"LocalStorage"},"ALSGetItemOptions":{"__symbolic":"reference","name":"LSGetItemOptions"},"AsyncLocalDatabase":{"__symbolic":"reference","name":"LocalDatabase"},"AsyncLocalStorageModule":{"__symbolic":"reference","name":"LocalStorageModule"}},"origins":{"JSONSchema":"./src/service/validation/json-schema","JSONSchemaType":"./src/service/validation/json-schema","LocalDatabase":"./src/service/databases/local-database","IndexedDBDatabase":"./src/service/databases/indexeddb-database","LocalStorageDatabase":"./src/service/databases/localstorage-database","MockLocalDatabase":"./src/service/databases/mock-local-database","JSONValidator":"./src/service/validation/json-validator","LSGetItemOptions":"./src/service/lib.service","LocalStorage":"./src/service/lib.service","ɵa":"./src/module","LocalStorageModule":"./src/module","localStorageProviders":"./src/tokens","LocalStorageProvidersConfig":"./src/tokens","LOCAL_STORAGE_PREFIX":"./src/tokens","AsyncLocalStorage":"./src/service/lib.service","ALSGetItemOptions":"./src/service/lib.service","AsyncLocalDatabase":"./src/service/databases/local-database","AsyncLocalStorageModule":"./src/module"},"importAs":"@ngx-pwa/local-storage"} |
{ | ||
"name": "@ngx-pwa/local-storage", | ||
"version": "5.3.5", | ||
"version": "5.3.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 @@ "main": "./bundles/local-storage.umd.js", |
/** | ||
* Types allowed in a JSON Schema | ||
* Types allowed in a JSON Schema. | ||
* Avoid `null` type: it will be removed in v8. | ||
*/ | ||
@@ -7,3 +8,3 @@ export declare type JSONSchemaType = 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object' | 'null'; | ||
* Subset of the JSON Schema. | ||
* Types are enforced to validate everything : each value MUST have either 'type' or 'properties' or 'items'. | ||
* Types are enforced to validate everything: each value MUST have a `type`. | ||
* Therefore, unlike the spec, booleans are not allowed as schemas. | ||
@@ -16,4 +17,4 @@ * @see http://json-schema.org/latest/json-schema-validation.html | ||
* Type for a primitive value. | ||
* Not required for objects, just set 'properties'. | ||
* Not required for arrays, just set 'items'. | ||
* Always explicit the `type`: it will be required in v8. | ||
* Avoid `null` type: it will be removed in v8. | ||
*/ | ||
@@ -36,2 +37,3 @@ type?: JSONSchemaType | JSONSchemaType[]; | ||
* 'type' of values should be a string (not an array of type). | ||
* Avoid using an array of JSON schemas: it won't be possible anymore in v8. | ||
*/ | ||
@@ -41,4 +43,5 @@ items?: JSONSchema | JSONSchema[]; | ||
* Allow other properties, to not fail with existing JSON schemas. | ||
* Avoid this: it won't be possible anymore in v8. | ||
*/ | ||
[k: string]: any; | ||
} |
import { InjectionToken, Provider } from '@angular/core'; | ||
/** | ||
* Avoid using this directly, use `localStorageProviders()` for configuration. | ||
* It will be removed in v8. | ||
*/ | ||
export declare const LOCAL_STORAGE_PREFIX: InjectionToken<string>; | ||
@@ -3,0 +7,0 @@ export interface LocalStorageProvidersConfig { |
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
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
0
127
1
1
1
2
302595
3104