@geekmidas/cache 0.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.
@@ -0,0 +1,16 @@
1
+ //#region src/memory.ts
2
+ var InMemoryCache = class {
3
+ store = /* @__PURE__ */ new Map();
4
+ async get(key) {
5
+ return this.store.get(key);
6
+ }
7
+ async set(key, value) {
8
+ this.store.set(key, value);
9
+ }
10
+ async delete(key) {
11
+ this.store.delete(key);
12
+ }
13
+ };
14
+
15
+ //#endregion
16
+ export { InMemoryCache };
@@ -0,0 +1,22 @@
1
+
2
+ //#region src/memory.ts
3
+ var InMemoryCache = class {
4
+ store = /* @__PURE__ */ new Map();
5
+ async get(key) {
6
+ return this.store.get(key);
7
+ }
8
+ async set(key, value) {
9
+ this.store.set(key, value);
10
+ }
11
+ async delete(key) {
12
+ this.store.delete(key);
13
+ }
14
+ };
15
+
16
+ //#endregion
17
+ Object.defineProperty(exports, 'InMemoryCache', {
18
+ enumerable: true,
19
+ get: function () {
20
+ return InMemoryCache;
21
+ }
22
+ });
@@ -0,0 +1,3 @@
1
+ const require_memory = require('./memory-n6Iosq6J.cjs');
2
+
3
+ exports.InMemoryCache = require_memory.InMemoryCache;
@@ -0,0 +1,3 @@
1
+ import { InMemoryCache } from "./memory-YteQXj7m.mjs";
2
+
3
+ export { InMemoryCache };
@@ -0,0 +1,26 @@
1
+ import { Redis } from "@upstash/redis";
2
+
3
+ //#region src/upstash.ts
4
+ var UpstashCache = class {
5
+ client;
6
+ constructor(url, token) {
7
+ this.client = new Redis({
8
+ url,
9
+ token
10
+ });
11
+ }
12
+ async get(key) {
13
+ const v = await this.client.get(key);
14
+ if (v === null) return void 0;
15
+ return v;
16
+ }
17
+ async set(key, value) {
18
+ await this.client.set(key, value);
19
+ }
20
+ async delete(key) {
21
+ await this.client.del(key);
22
+ }
23
+ };
24
+
25
+ //#endregion
26
+ export { UpstashCache };
@@ -0,0 +1,32 @@
1
+ const require_chunk = require('./chunk-CUT6urMc.cjs');
2
+ const __upstash_redis = require_chunk.__toESM(require("@upstash/redis"));
3
+
4
+ //#region src/upstash.ts
5
+ var UpstashCache = class {
6
+ client;
7
+ constructor(url, token) {
8
+ this.client = new __upstash_redis.Redis({
9
+ url,
10
+ token
11
+ });
12
+ }
13
+ async get(key) {
14
+ const v = await this.client.get(key);
15
+ if (v === null) return void 0;
16
+ return v;
17
+ }
18
+ async set(key, value) {
19
+ await this.client.set(key, value);
20
+ }
21
+ async delete(key) {
22
+ await this.client.del(key);
23
+ }
24
+ };
25
+
26
+ //#endregion
27
+ Object.defineProperty(exports, 'UpstashCache', {
28
+ enumerable: true,
29
+ get: function () {
30
+ return UpstashCache;
31
+ }
32
+ });
@@ -0,0 +1,3 @@
1
+ const require_upstash = require('./upstash-s7dedvpn.cjs');
2
+
3
+ exports.UpstashCache = require_upstash.UpstashCache;
@@ -0,0 +1,3 @@
1
+ import { UpstashCache } from "./upstash-Cpe9W0-L.mjs";
2
+
3
+ export { UpstashCache };