File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -38,12 +38,18 @@ export class MemoryStorage extends Storage {
38
38
39
39
// Validate MemoryStorageOptions
40
40
41
- this . db = new Map < string , unknown > ( options ?. entries ) ;
42
-
43
41
if ( options . scope ) {
44
42
this . scopeIdsKey = `memory_storage_scope_${ options . scope } _ids` ;
45
43
}
46
44
45
+ this . db = new Map < string , unknown > ( options ?. entries ) ;
46
+
47
+ if ( options . entries ) {
48
+ options . entries . forEach ( ( e ) => {
49
+ this . addScopeId ( e [ 0 ] ) ;
50
+ } ) ;
51
+ }
52
+
47
53
logger . trace ( 'Memory storage initialized' ) ;
48
54
}
49
55
@@ -86,7 +92,7 @@ export class MemoryStorage extends Storage {
86
92
* @returns
87
93
* @memberof MemoryStorage
88
94
*/
89
- private addScopeId ( id : string ) {
95
+ protected addScopeId ( id : string ) {
90
96
try {
91
97
if ( ! this . scopeIdsKey ) {
92
98
return ;
@@ -220,7 +226,7 @@ export class MemoryStorage extends Storage {
220
226
}
221
227
222
228
// Storage configuration
223
- export const createInitializer : StorageInitializerFunction =
229
+ export const createInitializer : StorageInitializerFunction < MemoryStorage > =
224
230
( options ?: MemoryStorageOptions ) =>
225
231
// eslint-disable-next-line @typescript-eslint/require-await
226
232
async ( ) : Promise < MemoryStorage > => {
You can’t perform that action at this time.
0 commit comments