@ribajs/cache
Advanced tools
Comparing version 1.8.0 to 1.9.0-alpha.0
{ | ||
"name": "@ribajs/cache", | ||
"description": "Cache module of Riba.js", | ||
"version": "1.8.0", | ||
"version": "1.9.0-alpha.0", | ||
"author": "Pascal Garber <pascal@artandcode.studio>", | ||
@@ -35,5 +35,3 @@ "contributors": [ | ||
], | ||
"scripts": { | ||
}, | ||
"devDependencies": {}, | ||
"scripts": {}, | ||
"bugs": { | ||
@@ -44,2 +42,2 @@ "url": "https://github.com/ribajs/riba/issues" | ||
"directories": {} | ||
} | ||
} |
@@ -1,38 +0,1 @@ | ||
/** | ||
* BaseCache it's a simple static cache | ||
*/ | ||
class BaseCache<T = any> { | ||
/** | ||
* The Object that keeps all the key value information | ||
*/ | ||
public data: {[key: string]: T}; | ||
constructor() { | ||
this.data = {}; | ||
} | ||
/** | ||
* Set a key and value data, mainly Barba is going to save promises | ||
* | ||
*/ | ||
public set(key: string, val: T) { | ||
return this.data[key] = val; | ||
} | ||
/** | ||
* Retrieve the data using the key | ||
*/ | ||
public get(key: string): T | undefined { | ||
return this.data[key]; | ||
} | ||
/** | ||
* Flush the cache | ||
*/ | ||
public reset() { | ||
this.data = {}; | ||
} | ||
} | ||
export { BaseCache }; | ||
export * from './services'; |
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
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
1706
4
37
1
59
0
1
0
11