cache-manager 7.0.0 → 7.0.1

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.
package/README.md CHANGED
@@ -22,7 +22,7 @@ A special thanks to [Tim Phan](https://github.com/timphandev) who took `cache-ma
22
22
 
23
23
  # Migration from v6 to v7
24
24
 
25
- `v7` has only one breaking change which is changine the return type from `null` to `undefined` when there is no data to return. This is to align with the [Keyv](https://keyv.org) API and to make it more consistent with the rest of the methods. Below is an example of how to migrate from `v6` to `v7`:
25
+ `v7` has only one breaking change which is changing the return type from `null` to `undefined` when there is no data to return. This is to align with the [Keyv](https://keyv.org) API and to make it more consistent with the rest of the methods. Below is an example of how to migrate from `v6` to `v7`:
26
26
 
27
27
  ```ts
28
28
  import { createCache } from 'cache-manager';
@@ -483,7 +483,7 @@ Returns the list of Keyv instances. This can be used to get the list of stores a
483
483
  const cache = createCache({cacheId: 'my-cache-id'});
484
484
  cache.cacheId(); // => 'my-cache-id'
485
485
  ```
486
- See unit tests in [`test/cache-id.test.ts`](./test/get.test.ts) for more information.
486
+ See unit tests in [`test/cache-id.test.ts`](./test/cache-id.test.ts) for more information.
487
487
 
488
488
  # Events
489
489
  ## set
package/dist/index.d.cts CHANGED
@@ -74,6 +74,11 @@ type Cache = {
74
74
  wrap<T>(key: string, fnc: () => T | Promise<T>, options: WrapOptionsRaw<T>): Promise<StoredDataRaw<T>>;
75
75
  };
76
76
  type Events = {
77
+ get: <T>(data: {
78
+ key: string;
79
+ value?: T;
80
+ error?: unknown;
81
+ }) => void;
77
82
  set: <T>(data: {
78
83
  key: string;
79
84
  value: T;
package/dist/index.d.ts CHANGED
@@ -74,6 +74,11 @@ type Cache = {
74
74
  wrap<T>(key: string, fnc: () => T | Promise<T>, options: WrapOptionsRaw<T>): Promise<StoredDataRaw<T>>;
75
75
  };
76
76
  type Events = {
77
+ get: <T>(data: {
78
+ key: string;
79
+ value?: T;
80
+ error?: unknown;
81
+ }) => void;
77
82
  set: <T>(data: {
78
83
  key: string;
79
84
  value: T;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cache-manager",
3
- "version": "7.0.0",
3
+ "version": "7.0.1",
4
4
  "description": "Cache Manager for Node.js",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -50,21 +50,21 @@
50
50
  ],
51
51
  "license": "MIT",
52
52
  "dependencies": {
53
- "keyv": "^5.3.3"
53
+ "keyv": "^5.3.4"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@faker-js/faker": "^9.8.0",
57
- "@keyv/redis": "^4.4.0",
58
- "@types/node": "^22.15.30",
59
- "@vitest/coverage-v8": "^3.2.2",
60
- "@vitest/spy": "^3.2.2",
57
+ "@keyv/redis": "^4.4.1",
58
+ "@types/node": "^24.0.6",
59
+ "@vitest/coverage-v8": "^3.2.4",
60
+ "@vitest/spy": "^3.2.4",
61
61
  "cache-manager-redis-yet": "^5.1.5",
62
62
  "rimraf": "^6.0.1",
63
63
  "tsup": "^8.5.0",
64
64
  "typescript": "^5.8.3",
65
- "vitest": "^3.2.2",
66
- "xo": "^1.0.5",
67
- "cacheable": "^1.9.0"
65
+ "vitest": "^3.2.4",
66
+ "xo": "^1.1.1",
67
+ "cacheable": "^1.10.0"
68
68
  },
69
69
  "xo": {
70
70
  "rules": {