angular-async-local-storage
Advanced tools
Comparing version 5.0.0 to 6.0.0-beta.0
import { Injectable, NgModule, PLATFORM_ID } from '@angular/core'; | ||
import { ReplaySubject } from 'rxjs/ReplaySubject'; | ||
import { ReplaySubject, fromEvent, of, race, throwError } from 'rxjs'; | ||
import { first, map, mergeMap } from 'rxjs/operators'; | ||
import { fromEvent } from 'rxjs/observable/fromEvent'; | ||
import { of } from 'rxjs/observable/of'; | ||
import { _throw } from 'rxjs/observable/throw'; | ||
import { race } from 'rxjs/observable/race'; | ||
import { isPlatformBrowser } from '@angular/common'; | ||
@@ -17,3 +13,3 @@ | ||
*/ | ||
var AsyncLocalDatabase = (function () { | ||
var AsyncLocalDatabase = /** @class */ (function () { | ||
function AsyncLocalDatabase() { | ||
@@ -38,3 +34,3 @@ } | ||
*/ | ||
var IndexedDBDatabase = (function (_super) { | ||
var IndexedDBDatabase = /** @class */ (function (_super) { | ||
__extends(IndexedDBDatabase, _super); | ||
@@ -305,3 +301,3 @@ /** | ||
return (/** @type {?} */ (fromEvent(request, 'error'))) | ||
.pipe(mergeMap(function (event) { return _throw(new Error("IndexedDB " + error + " issue : " + request.error.message + ".")); })); | ||
.pipe(mergeMap(function (event) { return throwError(new Error("IndexedDB " + error + " issue : " + request.error.message + ".")); })); | ||
}; | ||
@@ -330,3 +326,3 @@ IndexedDBDatabase.decorators = [ | ||
*/ | ||
var LocalStorageDatabase = (function (_super) { | ||
var LocalStorageDatabase = /** @class */ (function (_super) { | ||
__extends$1(LocalStorageDatabase, _super); | ||
@@ -364,3 +360,3 @@ function LocalStorageDatabase() { | ||
catch (/** @type {?} */ error) { | ||
return _throw(new Error("Invalid data in localStorage.")); | ||
return throwError(new Error("Invalid data in localStorage.")); | ||
} | ||
@@ -449,3 +445,3 @@ } | ||
*/ | ||
var MockLocalDatabase = (function (_super) { | ||
var MockLocalDatabase = /** @class */ (function (_super) { | ||
__extends$2(MockLocalDatabase, _super); | ||
@@ -550,3 +546,3 @@ function MockLocalDatabase() { | ||
*/ | ||
var JSONValidator = (function () { | ||
var JSONValidator = /** @class */ (function () { | ||
function JSONValidator() { | ||
@@ -783,3 +779,3 @@ this.simpleTypes = ['string', 'number', 'boolean', 'object']; | ||
var AsyncLocalStorage = (function () { | ||
var AsyncLocalStorage = /** @class */ (function () { | ||
function AsyncLocalStorage(database, jsonValidator) { | ||
@@ -822,6 +818,6 @@ this.database = database; | ||
catch (/** @type {?} */ error) { | ||
return _throw(error); | ||
return throwError(error); | ||
} | ||
if (!validation) { | ||
return _throw(new Error("JSON invalid")); | ||
return throwError(new Error("JSON invalid")); | ||
} | ||
@@ -919,3 +915,3 @@ } | ||
} | ||
var AsyncLocalStorageModule = (function () { | ||
var AsyncLocalStorageModule = /** @class */ (function () { | ||
function AsyncLocalStorageModule() { | ||
@@ -922,0 +918,0 @@ } |
import { Injectable, NgModule, PLATFORM_ID } from '@angular/core'; | ||
import { ReplaySubject } from 'rxjs/ReplaySubject'; | ||
import { ReplaySubject, fromEvent, of, race, throwError } from 'rxjs'; | ||
import { first, map, mergeMap } from 'rxjs/operators'; | ||
import { fromEvent } from 'rxjs/observable/fromEvent'; | ||
import { of } from 'rxjs/observable/of'; | ||
import { _throw } from 'rxjs/observable/throw'; | ||
import { race } from 'rxjs/observable/race'; | ||
import { isPlatformBrowser } from '@angular/common'; | ||
@@ -196,3 +192,3 @@ | ||
return (/** @type {?} */ (fromEvent(request, 'error'))) | ||
.pipe(mergeMap((event) => _throw(new Error(`IndexedDB ${error} issue : ${request.error.message}.`)))); | ||
.pipe(mergeMap((event) => throwError(new Error(`IndexedDB ${error} issue : ${request.error.message}.`)))); | ||
} | ||
@@ -230,3 +226,3 @@ } | ||
catch (/** @type {?} */ error) { | ||
return _throw(new Error(`Invalid data in localStorage.`)); | ||
return throwError(new Error(`Invalid data in localStorage.`)); | ||
} | ||
@@ -540,6 +536,6 @@ } | ||
catch (/** @type {?} */ error) { | ||
return _throw(error); | ||
return throwError(error); | ||
} | ||
if (!validation) { | ||
return _throw(new Error(`JSON invalid`)); | ||
return throwError(new Error(`JSON invalid`)); | ||
} | ||
@@ -546,0 +542,0 @@ } |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":4,"metadata":{"JSONSchema":{"__symbolic":"interface"},"JSONSchemaType":{"__symbolic":"interface"},"AsyncLocalDatabase":{"__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":12,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"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":8,"character":1}}],"members":{"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"}]}},"ALSGetItemOptions":{"__symbolic":"interface"},"AsyncLocalStorage":{"__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"}]}},"ɵa":{"__symbolic":"function"},"AsyncLocalStorageModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":31,"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":37,"character":13}]},{"__symbolic":"reference","name":"AsyncLocalStorage"}]}]}],"members":{}}},"origins":{"JSONSchema":"./src/service/validation/json-schema","JSONSchemaType":"./src/service/validation/json-schema","AsyncLocalDatabase":"./src/service/databases/async-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","ALSGetItemOptions":"./src/service/lib.service","AsyncLocalStorage":"./src/service/lib.service","ɵa":"./src/module","AsyncLocalStorageModule":"./src/module"},"importAs":"angular-async-local-storage"} | ||
{"__symbolic":"module","version":4,"metadata":{"JSONSchema":{"__symbolic":"interface"},"JSONSchemaType":{"__symbolic":"interface"},"AsyncLocalDatabase":{"__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":6,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"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":6,"character":1}}],"members":{"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":6,"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"}]}},"ALSGetItemOptions":{"__symbolic":"interface"},"AsyncLocalStorage":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":12,"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"}]}},"ɵa":{"__symbolic":"function"},"AsyncLocalStorageModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":31,"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":37,"character":13}]},{"__symbolic":"reference","name":"AsyncLocalStorage"}]}]}],"members":{}}},"origins":{"JSONSchema":"./src/service/validation/json-schema","JSONSchemaType":"./src/service/validation/json-schema","AsyncLocalDatabase":"./src/service/databases/async-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","ALSGetItemOptions":"./src/service/lib.service","AsyncLocalStorage":"./src/service/lib.service","ɵa":"./src/module","AsyncLocalStorageModule":"./src/module"},"importAs":"angular-async-local-storage"} |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(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')) : | ||
typeof define === 'function' && define.amd ? define(['exports', '@angular/core', 'rxjs/ReplaySubject', 'rxjs/operators', 'rxjs/observable/fromEvent', 'rxjs/observable/of', 'rxjs/observable/throw', 'rxjs/observable/race', '@angular/common'], factory) : | ||
(factory((global.angularAsyncLocalStorage = global.angularAsyncLocalStorage || {}),global.ng.core,global.Rx,global.Rx.operators,global.Rx.Observable,global.Rx.Observable,global.Rx.Observable,global.Rx.Observable,global.ng.common)); | ||
}(this, (function (exports,_angular_core,rxjs_ReplaySubject,rxjs_operators,rxjs_observable_fromEvent,rxjs_observable_of,rxjs_observable_throw,rxjs_observable_race,_angular_common) { 'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@angular/common')) : | ||
typeof define === 'function' && define.amd ? define(['exports', '@angular/core', 'rxjs', 'rxjs/operators', '@angular/common'], factory) : | ||
(factory((global.angularAsyncLocalStorage = global.angularAsyncLocalStorage || {}),global.ng.core,global.Rx,global.Rx.operators,global.ng.common)); | ||
}(this, (function (exports,_angular_core,rxjs,rxjs_operators,_angular_common) { 'use strict'; | ||
@@ -14,3 +14,3 @@ /** | ||
*/ | ||
var AsyncLocalDatabase = (function () { | ||
var AsyncLocalDatabase = /** @class */ (function () { | ||
function AsyncLocalDatabase() { | ||
@@ -35,3 +35,3 @@ } | ||
*/ | ||
var IndexedDBDatabase = (function (_super) { | ||
var IndexedDBDatabase = /** @class */ (function (_super) { | ||
__extends(IndexedDBDatabase, _super); | ||
@@ -61,3 +61,3 @@ /** | ||
/* Creating the RxJS ReplaySubject */ | ||
_this.database = new rxjs_ReplaySubject.ReplaySubject(); | ||
_this.database = new rxjs.ReplaySubject(); | ||
/* Connecting to IndexedDB */ | ||
@@ -90,5 +90,5 @@ /* Connecting to IndexedDB */ | ||
/* 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) { return result && (_this.dataPath in result) ? (/** @type {?} */ (result[_this.dataPath])) : null; })); | ||
var /** @type {?} */ success = (/** @type {?} */ (rxjs.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 */ | ||
return (/** @type {?} */ (rxjs_observable_race.race(success, _this.toErrorObservable(request, "getter")))) | ||
return (/** @type {?} */ (rxjs.race(success, _this.toErrorObservable(request, "getter")))) | ||
.pipe(rxjs_operators.first()); | ||
@@ -119,3 +119,3 @@ }), rxjs_operators.first()); | ||
if (data == null) { | ||
return rxjs_observable_of.of(true); | ||
return rxjs.of(true); | ||
} | ||
@@ -138,3 +138,3 @@ /* Opening a transaction and checking if the item already exists in local storage */ | ||
/* Merging success (passing true) and error events and autoclosing the observable */ | ||
return (/** @type {?} */ (rxjs_observable_race.race(_this.toSuccessObservable(request), _this.toErrorObservable(request, "setter")))) | ||
return (/** @type {?} */ (rxjs.race(_this.toSuccessObservable(request), _this.toErrorObservable(request, "setter")))) | ||
.pipe(rxjs_operators.first()); | ||
@@ -171,3 +171,3 @@ var _a, _b; | ||
/* Merging success (passing true) and error events and autoclosing the observable */ | ||
return (/** @type {?} */ (rxjs_observable_race.race(_this.toSuccessObservable(request), _this.toErrorObservable(request, "remover")))) | ||
return (/** @type {?} */ (rxjs.race(_this.toSuccessObservable(request), _this.toErrorObservable(request, "remover")))) | ||
.pipe(rxjs_operators.first()); | ||
@@ -177,3 +177,3 @@ })); | ||
/* Passing true if the item does not exist in local storage */ | ||
return rxjs_observable_of.of(true); | ||
return rxjs.of(true); | ||
}), rxjs_operators.first()); | ||
@@ -200,3 +200,3 @@ }; | ||
/* Merging success (passing true) and error events and autoclosing the observable */ | ||
return (/** @type {?} */ (rxjs_observable_race.race(_this.toSuccessObservable(request), _this.toErrorObservable(request, "clearer")))) | ||
return (/** @type {?} */ (rxjs.race(_this.toSuccessObservable(request), _this.toErrorObservable(request, "clearer")))) | ||
.pipe(rxjs_operators.first()); | ||
@@ -221,3 +221,3 @@ }), rxjs_operators.first()); | ||
/* Listening the event fired on first connection, creating the object store for local storage */ | ||
(/** @type {?} */ (rxjs_observable_fromEvent.fromEvent(request, 'upgradeneeded'))) | ||
(/** @type {?} */ (rxjs.fromEvent(request, 'upgradeneeded'))) | ||
.pipe(rxjs_operators.first()) | ||
@@ -234,5 +234,5 @@ .subscribe(function (event) { | ||
/* Listening the success event and converting to an RxJS Observable */ | ||
var /** @type {?} */ success = /** @type {?} */ (rxjs_observable_fromEvent.fromEvent(request, 'success')); | ||
var /** @type {?} */ success = /** @type {?} */ (rxjs.fromEvent(request, 'success')); | ||
/* Merging success and errors events */ | ||
(/** @type {?} */ (rxjs_observable_race.race(success, this.toErrorObservable(request, "connection")))) | ||
(/** @type {?} */ (rxjs.race(success, this.toErrorObservable(request, "connection")))) | ||
.pipe(rxjs_operators.first()) | ||
@@ -286,3 +286,3 @@ .subscribe(function (event) { | ||
/* Transforming a IndexedDB success event in an RxJS Observable with true value */ | ||
return (/** @type {?} */ (rxjs_observable_fromEvent.fromEvent(request, 'success'))) | ||
return (/** @type {?} */ (rxjs.fromEvent(request, 'success'))) | ||
.pipe(rxjs_operators.map(function () { return true; })); | ||
@@ -311,4 +311,4 @@ }; | ||
/* Transforming a IndexedDB error event in an RxJS ErrorObservable */ | ||
return (/** @type {?} */ (rxjs_observable_fromEvent.fromEvent(request, 'error'))) | ||
.pipe(rxjs_operators.mergeMap(function (event) { return rxjs_observable_throw._throw(new Error("IndexedDB " + error + " issue : " + request.error.message + ".")); })); | ||
return (/** @type {?} */ (rxjs.fromEvent(request, 'error'))) | ||
.pipe(rxjs_operators.mergeMap(function (event) { return rxjs.throwError(new Error("IndexedDB " + error + " issue : " + request.error.message + ".")); })); | ||
}; | ||
@@ -337,3 +337,3 @@ IndexedDBDatabase.decorators = [ | ||
*/ | ||
var LocalStorageDatabase = (function (_super) { | ||
var LocalStorageDatabase = /** @class */ (function (_super) { | ||
__extends$1(LocalStorageDatabase, _super); | ||
@@ -371,6 +371,6 @@ function LocalStorageDatabase() { | ||
catch (/** @type {?} */ error) { | ||
return rxjs_observable_throw._throw(new Error("Invalid data in localStorage.")); | ||
return rxjs.throwError(new Error("Invalid data in localStorage.")); | ||
} | ||
} | ||
return rxjs_observable_of.of(parsedData); | ||
return rxjs.of(parsedData); | ||
}; | ||
@@ -397,3 +397,3 @@ /** | ||
this.localStorage.setItem(key, JSON.stringify(data)); | ||
return rxjs_observable_of.of(true); | ||
return rxjs.of(true); | ||
}; | ||
@@ -417,3 +417,3 @@ /** | ||
this.localStorage.removeItem(key); | ||
return rxjs_observable_of.of(true); | ||
return rxjs.of(true); | ||
}; | ||
@@ -434,3 +434,3 @@ /** | ||
this.localStorage.clear(); | ||
return rxjs_observable_of.of(true); | ||
return rxjs.of(true); | ||
}; | ||
@@ -459,3 +459,3 @@ LocalStorageDatabase.decorators = [ | ||
*/ | ||
var MockLocalDatabase = (function (_super) { | ||
var MockLocalDatabase = /** @class */ (function (_super) { | ||
__extends$2(MockLocalDatabase, _super); | ||
@@ -486,3 +486,3 @@ function MockLocalDatabase() { | ||
var /** @type {?} */ rawData = this.localStorage.get(key); | ||
return rxjs_observable_of.of((rawData !== undefined) ? rawData : null); | ||
return rxjs.of((rawData !== undefined) ? rawData : null); | ||
}; | ||
@@ -509,3 +509,3 @@ /** | ||
this.localStorage.set(key, data); | ||
return rxjs_observable_of.of(true); | ||
return rxjs.of(true); | ||
}; | ||
@@ -529,3 +529,3 @@ /** | ||
this.localStorage.delete(key); | ||
return rxjs_observable_of.of(true); | ||
return rxjs.of(true); | ||
}; | ||
@@ -546,3 +546,3 @@ /** | ||
this.localStorage.clear(); | ||
return rxjs_observable_of.of(true); | ||
return rxjs.of(true); | ||
}; | ||
@@ -564,3 +564,3 @@ MockLocalDatabase.decorators = [ | ||
*/ | ||
var JSONValidator = (function () { | ||
var JSONValidator = /** @class */ (function () { | ||
function JSONValidator() { | ||
@@ -797,3 +797,3 @@ this.simpleTypes = ['string', 'number', 'boolean', 'object']; | ||
var AsyncLocalStorage = (function () { | ||
var AsyncLocalStorage = /** @class */ (function () { | ||
function AsyncLocalStorage(database, jsonValidator) { | ||
@@ -836,9 +836,9 @@ this.database = database; | ||
catch (/** @type {?} */ error) { | ||
return rxjs_observable_throw._throw(error); | ||
return rxjs.throwError(error); | ||
} | ||
if (!validation) { | ||
return rxjs_observable_throw._throw(new Error("JSON invalid")); | ||
return rxjs.throwError(new Error("JSON invalid")); | ||
} | ||
} | ||
return rxjs_observable_of.of(data); | ||
return rxjs.of(data); | ||
})); | ||
@@ -933,3 +933,3 @@ }; | ||
} | ||
var AsyncLocalStorageModule = (function () { | ||
var AsyncLocalStorageModule = /** @class */ (function () { | ||
function AsyncLocalStorageModule() { | ||
@@ -936,0 +936,0 @@ } |
@@ -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.angularAsyncLocalStorage=e.angularAsyncLocalStorage||{},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 p(e){return u.isPlatformBrowser(e)&&"indexedDB"in window&&void 0!==indexedDB&&null!==indexedDB?new f:u.isPlatformBrowser(e)&&"localStorage"in window&&void 0!==localStorage&&null!==localStorage?new b:new d}var c=function(){return function(){}}(),l=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)}}(),f=function(e){function u(){var t=e.call(this)||this;return t.dbName="ngStorage",t.objectStoreName="localStorage",t.keyPath="key",t.dataPath="value",t.database=new r.ReplaySubject,t.connect(),t}return l(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((p={},p[r.dataPath]=t,p),e)}return s.race(r.toSuccessObservable(i),r.toErrorObservable(i,"setter")).pipe(o.first());var u,p}))}),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[]},u}(c),y=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)}}(),b=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.localStorage=localStorage,t}return y(r,e),r.prototype.getItem=function(e){var t=this.localStorage.getItem(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 this.localStorage.setItem(e,JSON.stringify(t)),a.of(!0)},r.prototype.removeItem=function(e){return this.localStorage.removeItem(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}(c),h=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(){var t=null!==e&&e.apply(this,arguments)||this;return t.localStorage=new Map,t}return h(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}(c),m=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}(),v=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.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:c},{type:m}]},e}(),g=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{providers:[m,{provide:c,useFactory:p,deps:[t.PLATFORM_ID]},v]}]}],e.ctorParameters=function(){return[]},e}();e.AsyncLocalDatabase=c,e.IndexedDBDatabase=f,e.LocalStorageDatabase=b,e.MockLocalDatabase=d,e.JSONValidator=m,e.AsyncLocalStorage=v,e.AsyncLocalStorageModule=g,e.ɵa=p,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("rxjs"),require("rxjs/operators"),require("@angular/common")):"function"==typeof define&&define.amd?define(["exports","@angular/core","rxjs","rxjs/operators","@angular/common"],e):e(t.angularAsyncLocalStorage=t.angularAsyncLocalStorage||{},t.ng.core,t.Rx,t.Rx.operators,t.ng.common)}(this,function(t,e,r,o,n){"use strict";function a(t){return n.isPlatformBrowser(t)&&"indexedDB"in window&&void 0!==indexedDB&&null!==indexedDB?new u:n.isPlatformBrowser(t)&&"localStorage"in window&&void 0!==localStorage&&null!==localStorage?new c:new f}var i=function(){return function(){}}(),s=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),u=function(t){function n(){var e=t.call(this)||this;return e.dbName="ngStorage",e.objectStoreName="localStorage",e.keyPath="key",e.dataPath="value",e.database=new r.ReplaySubject,e.connect(),e}return s(n,t),n.prototype.getItem=function(t){var e=this;return this.transaction().pipe(o.map(function(e){return e.get(t)}),o.mergeMap(function(t){var n=r.fromEvent(t,"success").pipe(o.map(function(t){return t.target.result}),o.map(function(t){return t&&e.dataPath in t?t[e.dataPath]:null}));return r.race(n,e.toErrorObservable(t,"getter")).pipe(o.first())}),o.first())},n.prototype.setItem=function(t,e){var n=this;return null==e?r.of(!0):this.getItem(t).pipe(o.map(function(t){return null==t?"add":"put"}),o.mergeMap(function(a){return n.transaction("readwrite").pipe(o.mergeMap(function(i){var s;switch(a){case"add":s=i.add((u={},u[n.dataPath]=e,u),t);break;case"put":default:s=i.put((p={},p[n.dataPath]=e,p),t)}return r.race(n.toSuccessObservable(s),n.toErrorObservable(s,"setter")).pipe(o.first());var u,p}))}),o.first())},n.prototype.removeItem=function(t){var e=this;return this.getItem(t).pipe(o.mergeMap(function(n){return null!=n?e.transaction("readwrite").pipe(o.mergeMap(function(n){var a=n.delete(t);return r.race(e.toSuccessObservable(a),e.toErrorObservable(a,"remover")).pipe(o.first())})):r.of(!0)}),o.first())},n.prototype.clear=function(){var t=this;return this.transaction("readwrite").pipe(o.mergeMap(function(e){var n=e.clear();return r.race(t.toSuccessObservable(n),t.toErrorObservable(n,"clearer")).pipe(o.first())}),o.first())},n.prototype.connect=function(){var t=this,e=indexedDB.open(this.dbName);r.fromEvent(e,"upgradeneeded").pipe(o.first()).subscribe(function(e){var r=e.target.result;r.objectStoreNames.contains(t.objectStoreName)||r.createObjectStore(t.objectStoreName)});var n=r.fromEvent(e,"success");r.race(n,this.toErrorObservable(e,"connection")).pipe(o.first()).subscribe(function(e){t.database.next(e.target.result)},function(e){t.database.error(e)})},n.prototype.transaction=function(t){var e=this;return void 0===t&&(t="readonly"),this.database.pipe(o.map(function(r){return r.transaction([e.objectStoreName],t).objectStore(e.objectStoreName)}))},n.prototype.toSuccessObservable=function(t){return r.fromEvent(t,"success").pipe(o.map(function(){return!0}))},n.prototype.toErrorObservable=function(t,e){return void 0===e&&(e=""),r.fromEvent(t,"error").pipe(o.mergeMap(function(o){return r.throwError(new Error("IndexedDB "+e+" issue : "+t.error.message+"."))}))},n.decorators=[{type:e.Injectable}],n.ctorParameters=function(){return[]},n}(i),p=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),c=function(t){function o(){var e=null!==t&&t.apply(this,arguments)||this;return e.localStorage=localStorage,e}return p(o,t),o.prototype.getItem=function(t){var e=this.localStorage.getItem(t),o=null;if(null!=e)try{o=JSON.parse(e)}catch(t){return r.throwError(new Error("Invalid data in localStorage."))}return r.of(o)},o.prototype.setItem=function(t,e){return this.localStorage.setItem(t,JSON.stringify(e)),r.of(!0)},o.prototype.removeItem=function(t){return this.localStorage.removeItem(t),r.of(!0)},o.prototype.clear=function(){return this.localStorage.clear(),r.of(!0)},o.decorators=[{type:e.Injectable}],o.ctorParameters=function(){return[]},o}(i),l=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),f=function(t){function o(){var e=null!==t&&t.apply(this,arguments)||this;return e.localStorage=new Map,e}return l(o,t),o.prototype.getItem=function(t){var e=this.localStorage.get(t);return r.of(void 0!==e?e:null)},o.prototype.setItem=function(t,e){return this.localStorage.set(t,e),r.of(!0)},o.prototype.removeItem=function(t){return this.localStorage.delete(t),r.of(!0)},o.prototype.clear=function(){return this.localStorage.clear(),r.of(!0)},o.decorators=[{type:e.Injectable}],o.ctorParameters=function(){return[]},o}(i),y=function(){function t(){this.simpleTypes=["string","number","boolean","object"]}return t.prototype.isObjectNotNull=function(t){return null!==t&&"object"==typeof t},t.prototype.validate=function(t,e){if(!this.isObjectNotNull(e))throw new Error("A schema must be an object (unlike spec, booleans are not supported to enforce strict types).");if(!(e.hasOwnProperty("type")&&"array"!==e.type&&"object"!==e.type||e.hasOwnProperty("properties")||e.hasOwnProperty("items")))throw new Error("Each value must have a 'type' or 'properties' or 'items', to enforce strict types.");if(e.hasOwnProperty("type")&&!this.validateType(t,e))return!1;if(e.hasOwnProperty("items")&&!this.validateItems(t,e))return!1;if(e.hasOwnProperty("properties")){if(e.hasOwnProperty("required")&&!this.validateRequired(t,e))return!1;if(!this.validateProperties(t,e))return!1}return!0},t.prototype.validateProperties=function(t,e){if(!this.isObjectNotNull(t))return!1;if(!e.properties||!this.isObjectNotNull(e.properties))throw new Error("'properties' must be a schema object.");if(Object.keys(e.properties).length!==Object.keys(t).length)return!1;for(var r in e.properties)if(e.properties.hasOwnProperty(r)&&t.hasOwnProperty(r)&&!this.validate(t[r],e.properties[r]))return!1;return!0},t.prototype.validateRequired=function(t,e){if(!this.isObjectNotNull(t))return!1;if(!Array.isArray(e.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=e.required;r<o.length;r++){var n=o[r];if("string"!=typeof n)throw new Error("'required' array must contain strings only.");if(!e.properties||!e.properties.hasOwnProperty(n))throw new Error("'required' properties must be described in 'properties' too.");if(!t.hasOwnProperty(n))return!1}return!0},t.prototype.validateType=function(t,e){if(Array.isArray(e.type))return this.validateTypeList(t,e);if("string"!=typeof e.type)throw new Error("'type' must be a string (arrays of types are not supported yet).");return("null"!==e.type||null===t)&&((-1===this.simpleTypes.indexOf(e.type)||typeof t===e.type)&&!!("integer"!==e.type||"number"==typeof t&&Number.isInteger(t)))},t.prototype.validateTypeList=function(t,e){for(var r=[],o=0,n=e.type;o<n.length;o++){var a=n[o];r.push(this.validateType(t,{type:a}))}return-1!==r.indexOf(!0)},t.prototype.validateItems=function(t,e){if(!Array.isArray(t))return!1;if(Array.isArray(e.items))return this.validateItemsList(t,e);if(!e.items||!this.isObjectNotNull(e.items))throw new Error("'items' must be a schema object.");for(var r=0,o=t;r<o.length;r++){var n=o[r];if(!this.validate(n,e.items))return!1}return!0},t.prototype.validateItemsList=function(t,e){var r=e.items;if(t.length!==r.length)return!1;for(var o=0;o<r.length;o+=1)if(!this.validate(t[o],r[o]))return!1;return!0},t}(),d=function(){function t(t,e){this.database=t,this.jsonValidator=e,this.getItemOptionsDefault={schema:null}}return t.prototype.getItem=function(t,e){var n=this;return void 0===e&&(e=this.getItemOptionsDefault),this.database.getItem(t).pipe(o.mergeMap(function(t){if(e.schema&&null!==t){var o=!0;try{o=n.jsonValidator.validate(t,e.schema)}catch(t){return r.throwError(t)}if(!o)return r.throwError(new Error("JSON invalid"))}return r.of(t)}))},t.prototype.setItem=function(t,e){return this.database.setItem(t,e)},t.prototype.removeItem=function(t){return this.database.removeItem(t)},t.prototype.clear=function(){return this.database.clear()},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:i},{type:y}]},t}(),h=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{providers:[y,{provide:i,useFactory:a,deps:[e.PLATFORM_ID]},d]}]}],t.ctorParameters=function(){return[]},t}();t.AsyncLocalDatabase=i,t.IndexedDBDatabase=u,t.LocalStorageDatabase=c,t.MockLocalDatabase=f,t.JSONValidator=y,t.AsyncLocalStorage=d,t.AsyncLocalStorageModule=h,t.ɵa=a,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=angular-async-local-storage.umd.min.js.map |
{ | ||
"name": "angular-async-local-storage", | ||
"version": "5.0.0", | ||
"version": "6.0.0-beta.0", | ||
"description": "Efficient local storage module for Angular : 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.", | ||
@@ -19,2 +19,4 @@ "main": "./bundles/angular-async-local-storage.umd.js", | ||
"angular 5", | ||
"angular6", | ||
"angular 6", | ||
"localstorage", | ||
@@ -58,17 +60,17 @@ "local storage" | ||
"reinstall": "rimraf node_modules && npm install", | ||
"publish": "npm publish dist" | ||
"publish": "npm publish dist --tag next" | ||
}, | ||
"dependencies": {}, | ||
"peerDependencies": { | ||
"@angular/core": ">=5.0.0 <6.0.0", | ||
"@angular/common": ">=5.0.0 <6.0.0", | ||
"rxjs": "^5.5.2" | ||
"@angular/core": ">=6.0.0 <7.0.0 || >=6.0.0-rc <7.0.0", | ||
"@angular/common": ">=6.0.0 <7.0.0 || >=6.0.0-rc <7.0.0", | ||
"rxjs": ">=6.0.0 <7.0.0 || >=6.0.0-rc <7.0.0" | ||
}, | ||
"devDependencies": { | ||
"@angular/common": "^5.2.9", | ||
"@angular/compiler": "^5.2.9", | ||
"@angular/compiler-cli": "^5.2.9", | ||
"@angular/core": "^5.2.9", | ||
"@angular/platform-browser": "^5.2.9", | ||
"@angular/platform-browser-dynamic": "^5.2.9", | ||
"@angular/common": "^6.0.0-rc.1", | ||
"@angular/compiler": "^6.0.0-rc.1", | ||
"@angular/compiler-cli": "^6.0.0-rc.1", | ||
"@angular/core": "^6.0.0-rc.1", | ||
"@angular/platform-browser": "^6.0.0-rc.1", | ||
"@angular/platform-browser-dynamic": "^6.0.0-rc.1", | ||
"@types/jasmine": "2.5.36", | ||
@@ -100,9 +102,9 @@ "@types/node": "^6.0.46", | ||
"rollup-plugin-uglify": "^2.0.1", | ||
"rxjs": "^5.5.2", | ||
"rxjs": "^6.0.0-rc.0", | ||
"standard-version": "^4.0.0", | ||
"systemjs": "^0.19.40", | ||
"tslint": "^4.4.2", | ||
"typescript": "~2.4.2", | ||
"zone.js": "^0.8.4" | ||
"typescript": "~2.7.2", | ||
"zone.js": "~0.8.20" | ||
} | ||
} |
@@ -41,2 +41,5 @@ # Async local storage for Angular | ||
```bash | ||
# For Angular 6 (next): | ||
npm install angular-async-local-storage@next | ||
# For Angular 5 (latest): | ||
@@ -179,3 +182,3 @@ npm install angular-async-local-storage | ||
This lib major version is aligned to the major version of Angular. Meaning for Angular 4 you need version 4, | ||
for Angular 5 you need version 5, and so on. | ||
for Angular 5 you need version 5, for Angular 6 you need version 6, and so on. | ||
@@ -182,0 +185,0 @@ We follow [Angular LTS support](https://github.com/angular/angular/blob/master/docs/RELEASE_SCHEDULE.md), |
@@ -1,2 +0,2 @@ | ||
import { Observable } from 'rxjs/Observable'; | ||
import { Observable } from 'rxjs'; | ||
export declare abstract class AsyncLocalDatabase { | ||
@@ -3,0 +3,0 @@ abstract getItem<T = any>(key: string): Observable<T | null>; |
@@ -1,3 +0,2 @@ | ||
import { Observable } from 'rxjs/Observable'; | ||
import { ReplaySubject } from 'rxjs/ReplaySubject'; | ||
import { Observable, ReplaySubject } from 'rxjs'; | ||
import { AsyncLocalDatabase } from './async-local-database'; | ||
@@ -76,3 +75,3 @@ export declare class IndexedDBDatabase extends AsyncLocalDatabase { | ||
*/ | ||
protected toErrorObservable(request: IDBRequest, error?: string): Observable<any>; | ||
protected toErrorObservable(request: IDBRequest, error?: string): Observable<never>; | ||
} |
@@ -1,2 +0,2 @@ | ||
import { Observable } from 'rxjs/Observable'; | ||
import { Observable } from 'rxjs'; | ||
import { AsyncLocalDatabase } from './async-local-database'; | ||
@@ -3,0 +3,0 @@ export declare class LocalStorageDatabase extends AsyncLocalDatabase { |
@@ -1,2 +0,2 @@ | ||
import { Observable } from 'rxjs/Observable'; | ||
import { Observable } from 'rxjs'; | ||
import { AsyncLocalDatabase } from './async-local-database'; | ||
@@ -3,0 +3,0 @@ export declare class MockLocalDatabase extends AsyncLocalDatabase { |
@@ -1,2 +0,2 @@ | ||
import { Observable } from 'rxjs/Observable'; | ||
import { Observable } from 'rxjs'; | ||
import { AsyncLocalDatabase } from './databases/async-local-database'; | ||
@@ -20,3 +20,3 @@ import { JSONSchema } from './validation/json-schema'; | ||
*/ | ||
getItem<T = any>(key: string, options?: ALSGetItemOptions): Observable<any>; | ||
getItem<T = any>(key: string, options?: ALSGetItemOptions): Observable<T | null>; | ||
/** | ||
@@ -23,0 +23,0 @@ * Sets an item 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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
256
0
264964
2788
1
2