anote-server-libs 0.7.2 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ {
2
+ "typescript.tsdk": "node_modules\\typescript\\lib"
3
+ }
@@ -50,9 +50,9 @@ class MemoryCache {
50
50
  else
51
51
  return Promise.resolve(this.localCache[key]);
52
52
  }
53
- set(key, val) {
53
+ set(key, val, time = 15 * 60) {
54
54
  if (this.cache)
55
- return new Promise(resolve => this.cache.set(this.localKey + key, JSON.stringify(val), 15 * 60, resolve));
55
+ return new Promise(resolve => this.cache.set(this.localKey + key, JSON.stringify(val), time, resolve));
56
56
  else {
57
57
  this.localCache[key] = val;
58
58
  return Promise.resolve();
@@ -48,8 +48,8 @@ export class MemoryCache<T> {
48
48
  else return Promise.resolve(this.localCache[key]);
49
49
  }
50
50
 
51
- set(key: string | number, val: T): Promise<void> {
52
- if(this.cache) return new Promise(resolve => this.cache.set(this.localKey + key, JSON.stringify(val), 15 * 60, resolve));
51
+ set(key: string | number, val: T, time = 15 * 60): Promise<void> {
52
+ if(this.cache) return new Promise(resolve => this.cache.set(this.localKey + key, JSON.stringify(val), time, resolve));
53
53
  else {
54
54
  this.localCache[key] = val;
55
55
  return Promise.resolve();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anote-server-libs",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "description": "Helpers for express-TS servers",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",