koatty_store
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -0,1 +1,3 @@ | ||
import { MemcacheStore } from "./memcache"; | ||
import { RedisStore } from "./redis"; | ||
/** | ||
@@ -49,3 +51,3 @@ * | ||
*/ | ||
static getInstance(options: StoreOptions): Store; | ||
static getInstance(options: StoreOptions): MemcacheStore | RedisStore; | ||
} |
@@ -8,3 +8,3 @@ "use strict"; | ||
* @LastEditors: linyyyang<linyyyang@tencent.com> | ||
* @LastEditTime: 2020-11-30 17:38:08 | ||
* @LastEditTime: 2020-11-30 17:47:47 | ||
* @License: BSD (3-Clause) | ||
@@ -39,10 +39,3 @@ * @Copyright (c) - <richenlin(at)gmail.com> | ||
constructor(options) { | ||
switch (options.type) { | ||
case "memcache": | ||
return new memcache_1.MemcacheStore(options); | ||
break; | ||
default: | ||
return new redis_1.RedisStore(options); | ||
break; | ||
} | ||
return Store.getInstance(options); | ||
} | ||
@@ -57,2 +50,5 @@ /** | ||
static getInstance(options) { | ||
if (this.instance) { | ||
return this.instance; | ||
} | ||
options = { | ||
@@ -67,3 +63,11 @@ ...{ | ||
}; | ||
return this.instance || (this.instance = new Store(options)); | ||
switch (options.type) { | ||
case "memcache": | ||
this.instance = new memcache_1.MemcacheStore(options); | ||
break; | ||
default: | ||
this.instance = new redis_1.RedisStore(options); | ||
break; | ||
} | ||
return this.instance; | ||
} | ||
@@ -70,0 +74,0 @@ } |
{ | ||
"name": "koatty_store", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Cache store for koatty.", | ||
@@ -54,3 +54,3 @@ "scripts": { | ||
"tslint-config-alloy": "^0.2.1", | ||
"typescript": "^4.1.2" | ||
"typescript": "^4.x.x" | ||
}, | ||
@@ -57,0 +57,0 @@ "dependencies": { |
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
99457
1331