cacheable 1.8.5 → 1.8.7

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
@@ -1,8 +1,6 @@
1
1
  [<img align="center" src="https://cacheable.org/logo.svg" alt="Cacheable" />](https://github.com/jaredwray/cacheable)
2
2
 
3
- # Cacheable
4
-
5
- > Simple Caching Engine using Keyv
3
+ > High Performance Layer 1 / Layer 2 Caching with Keyv Storage
6
4
 
7
5
  [![codecov](https://codecov.io/gh/jaredwray/cacheable/graph/badge.svg?token=lWZ9OBQ7GM)](https://codecov.io/gh/jaredwray/cacheable)
8
6
  [![tests](https://github.com/jaredwray/cacheable/actions/workflows/tests.yml/badge.svg)](https://github.com/jaredwray/cacheable/actions/workflows/tests.yml)
@@ -375,7 +373,7 @@ import { KeyvCacheableMemory } from 'cacheable';
375
373
 
376
374
  const keyv = new Keyv({ store: new KeyvCacheableMemory() });
377
375
  await keyv.set('foo', 'bar');
378
- const value = await keyv.get('key');
376
+ const value = await keyv.get('foo');
379
377
  console.log(value); // bar
380
378
  ```
381
379
 
package/dist/index.cjs CHANGED
@@ -28,23 +28,24 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
 
30
30
  // src/index.ts
31
- var src_exports = {};
32
- __export(src_exports, {
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
33
  Cacheable: () => Cacheable,
34
34
  CacheableEvents: () => CacheableEvents,
35
35
  CacheableHooks: () => CacheableHooks,
36
36
  CacheableMemory: () => CacheableMemory,
37
37
  CacheableStats: () => CacheableStats,
38
- Keyv: () => import_keyv2.Keyv,
38
+ Keyv: () => import_keyv3.Keyv,
39
39
  KeyvCacheableMemory: () => KeyvCacheableMemory,
40
- KeyvHooks: () => import_keyv2.KeyvHooks,
40
+ KeyvHooks: () => import_keyv3.KeyvHooks,
41
+ createKeyv: () => createKeyv,
41
42
  shorthandToMilliseconds: () => shorthandToMilliseconds,
42
43
  shorthandToTime: () => shorthandToTime,
43
44
  wrap: () => wrap,
44
45
  wrapSync: () => wrapSync
45
46
  });
46
- module.exports = __toCommonJS(src_exports);
47
- var import_keyv = require("keyv");
47
+ module.exports = __toCommonJS(index_exports);
48
+ var import_keyv2 = require("keyv");
48
49
  var import_hookified2 = require("hookified");
49
50
 
50
51
  // src/shorthand-time.ts
@@ -114,6 +115,9 @@ var shorthandToTime = (shorthand, fromDate) => {
114
115
  return fromDate.getTime() + milliseconds;
115
116
  };
116
117
 
118
+ // src/keyv-memory.ts
119
+ var import_keyv = require("keyv");
120
+
117
121
  // src/memory.ts
118
122
  var import_hookified = require("hookified");
119
123
 
@@ -496,7 +500,8 @@ var CacheableMemory = class extends import_hookified.Hookified {
496
500
  * Sets the value of the key
497
501
  * @param {string} key - The key to set the value
498
502
  * @param {any} value - The value to set
499
- * @param {number|string} [ttl] - Time to Live - If you set a number it is miliseconds, if you set a string it is a human-readable.
503
+ * @param {number|string|SetOptions} [ttl] - Time to Live - If you set a number it is miliseconds, if you set a string it is a human-readable.
504
+ * If you want to set expire directly you can do that by setting the expire property in the SetOptions.
500
505
  * If you set undefined, it will use the default time-to-live. If both are undefined then it will not have a time-to-live.
501
506
  * @returns {void}
502
507
  */
@@ -504,9 +509,21 @@ var CacheableMemory = class extends import_hookified.Hookified {
504
509
  const store = this.getStore(key);
505
510
  let expires;
506
511
  if (ttl !== void 0 || this._ttl !== void 0) {
507
- const finalTtl = shorthandToTime(ttl ?? this._ttl);
508
- if (finalTtl !== void 0) {
509
- expires = finalTtl;
512
+ if (typeof ttl === "object") {
513
+ if (ttl.expire) {
514
+ expires = typeof ttl.expire === "number" ? ttl.expire : ttl.expire.getTime();
515
+ }
516
+ if (ttl.ttl) {
517
+ const finalTtl = shorthandToTime(ttl.ttl);
518
+ if (finalTtl !== void 0) {
519
+ expires = finalTtl;
520
+ }
521
+ }
522
+ } else {
523
+ const finalTtl = shorthandToTime(ttl ?? this._ttl);
524
+ if (finalTtl !== void 0) {
525
+ expires = finalTtl;
526
+ }
510
527
  }
511
528
  }
512
529
  if (this._lruSize > 0) {
@@ -757,9 +774,12 @@ var CacheableMemory = class extends import_hookified.Hookified {
757
774
  */
758
775
  startIntervalCheck() {
759
776
  if (this._checkInterval > 0) {
777
+ if (this._interval) {
778
+ clearInterval(this._interval);
779
+ }
760
780
  this._interval = setInterval(() => {
761
781
  this.checkExpiration();
762
- }, this._checkInterval);
782
+ }, this._checkInterval).unref();
763
783
  }
764
784
  }
765
785
  /**
@@ -895,6 +915,18 @@ var KeyvCacheableMemory = class {
895
915
  return this._nCache.get(namespace);
896
916
  }
897
917
  };
918
+ function createKeyv(options) {
919
+ const store = new KeyvCacheableMemory(options);
920
+ const namespace = options?.namespace;
921
+ let ttl;
922
+ if (options?.ttl && Number.isInteger(options.ttl)) {
923
+ ttl = options?.ttl;
924
+ }
925
+ const keyv = new import_keyv.Keyv({ store, namespace, ttl });
926
+ keyv.serialize = void 0;
927
+ keyv.deserialize = void 0;
928
+ return keyv;
929
+ }
898
930
 
899
931
  // src/stats.ts
900
932
  var CacheableStats = class {
@@ -1114,7 +1146,7 @@ var CacheableStats = class {
1114
1146
  };
1115
1147
 
1116
1148
  // src/index.ts
1117
- var import_keyv2 = require("keyv");
1149
+ var import_keyv3 = require("keyv");
1118
1150
  var CacheableHooks = /* @__PURE__ */ ((CacheableHooks2) => {
1119
1151
  CacheableHooks2["BEFORE_SET"] = "BEFORE_SET";
1120
1152
  CacheableHooks2["AFTER_SET"] = "AFTER_SET";
@@ -1131,7 +1163,7 @@ var CacheableEvents = /* @__PURE__ */ ((CacheableEvents2) => {
1131
1163
  return CacheableEvents2;
1132
1164
  })(CacheableEvents || {});
1133
1165
  var Cacheable = class extends import_hookified2.Hookified {
1134
- _primary = new import_keyv.Keyv({ store: new KeyvCacheableMemory() });
1166
+ _primary = createKeyv();
1135
1167
  _secondary;
1136
1168
  _nonBlocking = false;
1137
1169
  _ttl;
@@ -1290,7 +1322,7 @@ var Cacheable = class extends import_hookified2.Hookified {
1290
1322
  * @returns {void}
1291
1323
  */
1292
1324
  setPrimary(primary) {
1293
- this._primary = primary instanceof import_keyv.Keyv ? primary : new import_keyv.Keyv(primary);
1325
+ this._primary = primary instanceof import_keyv2.Keyv ? primary : new import_keyv2.Keyv(primary);
1294
1326
  this._primary.on("error", (error) => {
1295
1327
  this.emit("error" /* ERROR */, error);
1296
1328
  });
@@ -1301,7 +1333,7 @@ var Cacheable = class extends import_hookified2.Hookified {
1301
1333
  * @returns {void}
1302
1334
  */
1303
1335
  setSecondary(secondary) {
1304
- this._secondary = secondary instanceof import_keyv.Keyv ? secondary : new import_keyv.Keyv(secondary);
1336
+ this._secondary = secondary instanceof import_keyv2.Keyv ? secondary : new import_keyv2.Keyv(secondary);
1305
1337
  this._secondary.on("error", (error) => {
1306
1338
  this.emit("error" /* ERROR */, error);
1307
1339
  });
@@ -1665,6 +1697,7 @@ var Cacheable = class extends import_hookified2.Hookified {
1665
1697
  Keyv,
1666
1698
  KeyvCacheableMemory,
1667
1699
  KeyvHooks,
1700
+ createKeyv,
1668
1701
  shorthandToMilliseconds,
1669
1702
  shorthandToTime,
1670
1703
  wrap,
package/dist/index.d.cts CHANGED
@@ -139,6 +139,10 @@ type CacheableMemoryOptions = {
139
139
  lruSize?: number;
140
140
  checkInterval?: number;
141
141
  };
142
+ type SetOptions = {
143
+ ttl?: number | string;
144
+ expire?: number | Date;
145
+ };
142
146
  declare class CacheableMemory extends Hookified {
143
147
  private _lru;
144
148
  private readonly _hashCache;
@@ -245,11 +249,12 @@ declare class CacheableMemory extends Hookified {
245
249
  * Sets the value of the key
246
250
  * @param {string} key - The key to set the value
247
251
  * @param {any} value - The value to set
248
- * @param {number|string} [ttl] - Time to Live - If you set a number it is miliseconds, if you set a string it is a human-readable.
252
+ * @param {number|string|SetOptions} [ttl] - Time to Live - If you set a number it is miliseconds, if you set a string it is a human-readable.
253
+ * If you want to set expire directly you can do that by setting the expire property in the SetOptions.
249
254
  * If you set undefined, it will use the default time-to-live. If both are undefined then it will not have a time-to-live.
250
255
  * @returns {void}
251
256
  */
252
- set(key: string, value: any, ttl?: number | string): void;
257
+ set(key: string, value: any, ttl?: number | string | SetOptions): void;
253
258
  /**
254
259
  * Sets the values of the keys
255
260
  * @param {CacheableItem[]} items - The items to set
@@ -366,7 +371,7 @@ declare class CacheableMemory extends Hookified {
366
371
  * @param {Object} [options] - The options to wrap
367
372
  * @returns {Function} - The wrapped function
368
373
  */
369
- wrap<T>(function_: (...arguments_: any[]) => T, options?: WrapFunctionOptions): (...arguments_: any[]) => T;
374
+ wrap<T, Arguments extends any[]>(function_: (...arguments_: Arguments) => T, options?: WrapFunctionOptions): (...arguments_: Arguments) => T;
370
375
  private isPrimitive;
371
376
  private concatStores;
372
377
  private setTtl;
@@ -399,6 +404,12 @@ declare class KeyvCacheableMemory implements KeyvStoreAdapter {
399
404
  on(event: string, listener: (...arguments_: any[]) => void): this;
400
405
  getStore(namespace?: string): CacheableMemory;
401
406
  }
407
+ /**
408
+ * Creates a new Keyv instance with a new KeyvCacheableMemory store. This also removes the serialize/deserialize methods from the Keyv instance for optimization.
409
+ * @param options
410
+ * @returns
411
+ */
412
+ declare function createKeyv(options?: KeyvCacheableMemoryOptions): Keyv;
402
413
 
403
414
  declare const shorthandToMilliseconds: (shorthand?: string | number) => number | undefined;
404
415
  declare const shorthandToTime: (shorthand?: string | number, fromDate?: Date) => number;
@@ -622,7 +633,7 @@ declare class Cacheable extends Hookified {
622
633
  * @param {WrapOptions} [options] The options for the wrap function
623
634
  * @returns {Function} The wrapped function
624
635
  */
625
- wrap<T>(function_: (...arguments_: any[]) => T, options?: WrapFunctionOptions): (...arguments_: any[]) => T;
636
+ wrap<T, Arguments extends any[]>(function_: (...arguments_: Arguments) => T, options?: WrapFunctionOptions): (...arguments_: Arguments) => T;
626
637
  /**
627
638
  * Will hash an object using the specified algorithm. The default algorithm is 'sha256'.
628
639
  * @param {any} object the object to hash
@@ -636,4 +647,4 @@ declare class Cacheable extends Hookified {
636
647
  private setTtl;
637
648
  }
638
649
 
639
- export { Cacheable, CacheableEvents, CacheableHooks, type CacheableItem, CacheableMemory, type CacheableMemoryOptions, type CacheableOptions, CacheableStats, KeyvCacheableMemory, type WrapOptions, type WrapSyncOptions, shorthandToMilliseconds, shorthandToTime, wrap, wrapSync };
650
+ export { Cacheable, CacheableEvents, CacheableHooks, type CacheableItem, CacheableMemory, type CacheableMemoryOptions, type CacheableOptions, CacheableStats, KeyvCacheableMemory, type WrapOptions, type WrapSyncOptions, createKeyv, shorthandToMilliseconds, shorthandToTime, wrap, wrapSync };
package/dist/index.d.ts CHANGED
@@ -139,6 +139,10 @@ type CacheableMemoryOptions = {
139
139
  lruSize?: number;
140
140
  checkInterval?: number;
141
141
  };
142
+ type SetOptions = {
143
+ ttl?: number | string;
144
+ expire?: number | Date;
145
+ };
142
146
  declare class CacheableMemory extends Hookified {
143
147
  private _lru;
144
148
  private readonly _hashCache;
@@ -245,11 +249,12 @@ declare class CacheableMemory extends Hookified {
245
249
  * Sets the value of the key
246
250
  * @param {string} key - The key to set the value
247
251
  * @param {any} value - The value to set
248
- * @param {number|string} [ttl] - Time to Live - If you set a number it is miliseconds, if you set a string it is a human-readable.
252
+ * @param {number|string|SetOptions} [ttl] - Time to Live - If you set a number it is miliseconds, if you set a string it is a human-readable.
253
+ * If you want to set expire directly you can do that by setting the expire property in the SetOptions.
249
254
  * If you set undefined, it will use the default time-to-live. If both are undefined then it will not have a time-to-live.
250
255
  * @returns {void}
251
256
  */
252
- set(key: string, value: any, ttl?: number | string): void;
257
+ set(key: string, value: any, ttl?: number | string | SetOptions): void;
253
258
  /**
254
259
  * Sets the values of the keys
255
260
  * @param {CacheableItem[]} items - The items to set
@@ -366,7 +371,7 @@ declare class CacheableMemory extends Hookified {
366
371
  * @param {Object} [options] - The options to wrap
367
372
  * @returns {Function} - The wrapped function
368
373
  */
369
- wrap<T>(function_: (...arguments_: any[]) => T, options?: WrapFunctionOptions): (...arguments_: any[]) => T;
374
+ wrap<T, Arguments extends any[]>(function_: (...arguments_: Arguments) => T, options?: WrapFunctionOptions): (...arguments_: Arguments) => T;
370
375
  private isPrimitive;
371
376
  private concatStores;
372
377
  private setTtl;
@@ -399,6 +404,12 @@ declare class KeyvCacheableMemory implements KeyvStoreAdapter {
399
404
  on(event: string, listener: (...arguments_: any[]) => void): this;
400
405
  getStore(namespace?: string): CacheableMemory;
401
406
  }
407
+ /**
408
+ * Creates a new Keyv instance with a new KeyvCacheableMemory store. This also removes the serialize/deserialize methods from the Keyv instance for optimization.
409
+ * @param options
410
+ * @returns
411
+ */
412
+ declare function createKeyv(options?: KeyvCacheableMemoryOptions): Keyv;
402
413
 
403
414
  declare const shorthandToMilliseconds: (shorthand?: string | number) => number | undefined;
404
415
  declare const shorthandToTime: (shorthand?: string | number, fromDate?: Date) => number;
@@ -622,7 +633,7 @@ declare class Cacheable extends Hookified {
622
633
  * @param {WrapOptions} [options] The options for the wrap function
623
634
  * @returns {Function} The wrapped function
624
635
  */
625
- wrap<T>(function_: (...arguments_: any[]) => T, options?: WrapFunctionOptions): (...arguments_: any[]) => T;
636
+ wrap<T, Arguments extends any[]>(function_: (...arguments_: Arguments) => T, options?: WrapFunctionOptions): (...arguments_: Arguments) => T;
626
637
  /**
627
638
  * Will hash an object using the specified algorithm. The default algorithm is 'sha256'.
628
639
  * @param {any} object the object to hash
@@ -636,4 +647,4 @@ declare class Cacheable extends Hookified {
636
647
  private setTtl;
637
648
  }
638
649
 
639
- export { Cacheable, CacheableEvents, CacheableHooks, type CacheableItem, CacheableMemory, type CacheableMemoryOptions, type CacheableOptions, CacheableStats, KeyvCacheableMemory, type WrapOptions, type WrapSyncOptions, shorthandToMilliseconds, shorthandToTime, wrap, wrapSync };
650
+ export { Cacheable, CacheableEvents, CacheableHooks, type CacheableItem, CacheableMemory, type CacheableMemoryOptions, type CacheableOptions, CacheableStats, KeyvCacheableMemory, type WrapOptions, type WrapSyncOptions, createKeyv, shorthandToMilliseconds, shorthandToTime, wrap, wrapSync };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/index.ts
2
- import { Keyv } from "keyv";
2
+ import { Keyv as Keyv2 } from "keyv";
3
3
  import { Hookified as Hookified2 } from "hookified";
4
4
 
5
5
  // src/shorthand-time.ts
@@ -69,6 +69,11 @@ var shorthandToTime = (shorthand, fromDate) => {
69
69
  return fromDate.getTime() + milliseconds;
70
70
  };
71
71
 
72
+ // src/keyv-memory.ts
73
+ import {
74
+ Keyv
75
+ } from "keyv";
76
+
72
77
  // src/memory.ts
73
78
  import { Hookified } from "hookified";
74
79
 
@@ -451,7 +456,8 @@ var CacheableMemory = class extends Hookified {
451
456
  * Sets the value of the key
452
457
  * @param {string} key - The key to set the value
453
458
  * @param {any} value - The value to set
454
- * @param {number|string} [ttl] - Time to Live - If you set a number it is miliseconds, if you set a string it is a human-readable.
459
+ * @param {number|string|SetOptions} [ttl] - Time to Live - If you set a number it is miliseconds, if you set a string it is a human-readable.
460
+ * If you want to set expire directly you can do that by setting the expire property in the SetOptions.
455
461
  * If you set undefined, it will use the default time-to-live. If both are undefined then it will not have a time-to-live.
456
462
  * @returns {void}
457
463
  */
@@ -459,9 +465,21 @@ var CacheableMemory = class extends Hookified {
459
465
  const store = this.getStore(key);
460
466
  let expires;
461
467
  if (ttl !== void 0 || this._ttl !== void 0) {
462
- const finalTtl = shorthandToTime(ttl ?? this._ttl);
463
- if (finalTtl !== void 0) {
464
- expires = finalTtl;
468
+ if (typeof ttl === "object") {
469
+ if (ttl.expire) {
470
+ expires = typeof ttl.expire === "number" ? ttl.expire : ttl.expire.getTime();
471
+ }
472
+ if (ttl.ttl) {
473
+ const finalTtl = shorthandToTime(ttl.ttl);
474
+ if (finalTtl !== void 0) {
475
+ expires = finalTtl;
476
+ }
477
+ }
478
+ } else {
479
+ const finalTtl = shorthandToTime(ttl ?? this._ttl);
480
+ if (finalTtl !== void 0) {
481
+ expires = finalTtl;
482
+ }
465
483
  }
466
484
  }
467
485
  if (this._lruSize > 0) {
@@ -712,9 +730,12 @@ var CacheableMemory = class extends Hookified {
712
730
  */
713
731
  startIntervalCheck() {
714
732
  if (this._checkInterval > 0) {
733
+ if (this._interval) {
734
+ clearInterval(this._interval);
735
+ }
715
736
  this._interval = setInterval(() => {
716
737
  this.checkExpiration();
717
- }, this._checkInterval);
738
+ }, this._checkInterval).unref();
718
739
  }
719
740
  }
720
741
  /**
@@ -850,6 +871,18 @@ var KeyvCacheableMemory = class {
850
871
  return this._nCache.get(namespace);
851
872
  }
852
873
  };
874
+ function createKeyv(options) {
875
+ const store = new KeyvCacheableMemory(options);
876
+ const namespace = options?.namespace;
877
+ let ttl;
878
+ if (options?.ttl && Number.isInteger(options.ttl)) {
879
+ ttl = options?.ttl;
880
+ }
881
+ const keyv = new Keyv({ store, namespace, ttl });
882
+ keyv.serialize = void 0;
883
+ keyv.deserialize = void 0;
884
+ return keyv;
885
+ }
853
886
 
854
887
  // src/stats.ts
855
888
  var CacheableStats = class {
@@ -1071,7 +1104,7 @@ var CacheableStats = class {
1071
1104
  // src/index.ts
1072
1105
  import {
1073
1106
  KeyvHooks,
1074
- Keyv as Keyv2
1107
+ Keyv as Keyv3
1075
1108
  } from "keyv";
1076
1109
  var CacheableHooks = /* @__PURE__ */ ((CacheableHooks2) => {
1077
1110
  CacheableHooks2["BEFORE_SET"] = "BEFORE_SET";
@@ -1089,7 +1122,7 @@ var CacheableEvents = /* @__PURE__ */ ((CacheableEvents2) => {
1089
1122
  return CacheableEvents2;
1090
1123
  })(CacheableEvents || {});
1091
1124
  var Cacheable = class extends Hookified2 {
1092
- _primary = new Keyv({ store: new KeyvCacheableMemory() });
1125
+ _primary = createKeyv();
1093
1126
  _secondary;
1094
1127
  _nonBlocking = false;
1095
1128
  _ttl;
@@ -1248,7 +1281,7 @@ var Cacheable = class extends Hookified2 {
1248
1281
  * @returns {void}
1249
1282
  */
1250
1283
  setPrimary(primary) {
1251
- this._primary = primary instanceof Keyv ? primary : new Keyv(primary);
1284
+ this._primary = primary instanceof Keyv2 ? primary : new Keyv2(primary);
1252
1285
  this._primary.on("error", (error) => {
1253
1286
  this.emit("error" /* ERROR */, error);
1254
1287
  });
@@ -1259,7 +1292,7 @@ var Cacheable = class extends Hookified2 {
1259
1292
  * @returns {void}
1260
1293
  */
1261
1294
  setSecondary(secondary) {
1262
- this._secondary = secondary instanceof Keyv ? secondary : new Keyv(secondary);
1295
+ this._secondary = secondary instanceof Keyv2 ? secondary : new Keyv2(secondary);
1263
1296
  this._secondary.on("error", (error) => {
1264
1297
  this.emit("error" /* ERROR */, error);
1265
1298
  });
@@ -1619,9 +1652,10 @@ export {
1619
1652
  CacheableHooks,
1620
1653
  CacheableMemory,
1621
1654
  CacheableStats,
1622
- Keyv2 as Keyv,
1655
+ Keyv3 as Keyv,
1623
1656
  KeyvCacheableMemory,
1624
1657
  KeyvHooks,
1658
+ createKeyv,
1625
1659
  shorthandToMilliseconds,
1626
1660
  shorthandToTime,
1627
1661
  wrap,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cacheable",
3
- "version": "1.8.5",
4
- "description": "Simple Caching Engine using Keyv",
3
+ "version": "1.8.7",
4
+ "description": "High Performance Layer 1 / Layer 2 Caching with Keyv Storage",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
7
7
  "module": "./dist/index.js",
@@ -21,19 +21,19 @@
21
21
  "license": "MIT",
22
22
  "private": false,
23
23
  "devDependencies": {
24
- "@keyv/redis": "^3.0.1",
25
- "@types/node": "^22.9.0",
26
- "@vitest/coverage-v8": "^2.1.4",
24
+ "@keyv/redis": "^4.2.0",
25
+ "@types/node": "^22.10.2",
26
+ "@vitest/coverage-v8": "^2.1.8",
27
27
  "lru-cache": "^11.0.2",
28
28
  "rimraf": "^6.0.1",
29
29
  "tsup": "^8.3.5",
30
- "typescript": "^5.6.3",
31
- "vitest": "^2.1.4",
32
- "xo": "^0.59.3"
30
+ "typescript": "^5.7.2",
31
+ "vitest": "^2.1.8",
32
+ "xo": "^0.60.0"
33
33
  },
34
34
  "dependencies": {
35
- "hookified": "^1.5.0",
36
- "keyv": "^5.2.1"
35
+ "hookified": "^1.6.0",
36
+ "keyv": "^5.2.3"
37
37
  },
38
38
  "keywords": [
39
39
  "cacheable",
@@ -67,6 +67,7 @@
67
67
  ],
68
68
  "scripts": {
69
69
  "build": "rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean",
70
+ "prepublish": "pnpm build",
70
71
  "test": "xo --fix && vitest run --coverage",
71
72
  "test:ci": "xo && vitest run",
72
73
  "clean": "rimraf ./dist ./coverage ./node_modules"