@fedify/cfworkers 2.4.0-dev.2212 → 2.4.0-dev.2219

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.
Files changed (2) hide show
  1. package/dist/mod.js +6 -6
  2. package/package.json +2 -2
package/dist/mod.js CHANGED
@@ -26,10 +26,10 @@ var WorkersKvStore = class {
26
26
  }
27
27
  async get(key) {
28
28
  const encodedKey = this.#encodeKey(key);
29
- const { value, metadata } = await this.#namespace.getWithMetadata(encodedKey, "json");
29
+ const { value, metadata } = await this.#namespace.getWithMetadata(encodedKey);
30
30
  if (value == null) return void 0;
31
31
  if (metadata?.expires != null && metadata.expires < Date.now()) return;
32
- return value;
32
+ return JSON.parse(value);
33
33
  }
34
34
  async set(key, value, options) {
35
35
  const encodedKey = this.#encodeKey(key);
@@ -55,10 +55,10 @@ var WorkersKvStore = class {
55
55
  pattern = JSON.stringify(prefix).slice(0, -1) + ",";
56
56
  }
57
57
  if (exactKey != null) {
58
- const { value, metadata } = await this.#namespace.getWithMetadata(exactKey, "json");
58
+ const { value, metadata } = await this.#namespace.getWithMetadata(exactKey);
59
59
  if (value != null && (metadata == null || metadata.expires == null || metadata.expires >= Date.now())) yield {
60
60
  key: prefix,
61
- value
61
+ value: JSON.parse(value)
62
62
  };
63
63
  }
64
64
  let cursor;
@@ -71,11 +71,11 @@ var WorkersKvStore = class {
71
71
  for (const keyInfo of result.keys) {
72
72
  const metadata = keyInfo.metadata;
73
73
  if (metadata?.expires != null && metadata.expires < Date.now()) continue;
74
- const value = await this.#namespace.get(keyInfo.name, "json");
74
+ const value = await this.#namespace.get(keyInfo.name);
75
75
  if (value == null) continue;
76
76
  yield {
77
77
  key: JSON.parse(keyInfo.name),
78
- value
78
+ value: JSON.parse(value)
79
79
  };
80
80
  }
81
81
  } while (cursor != null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/cfworkers",
3
- "version": "2.4.0-dev.2212+26ce9858",
3
+ "version": "2.4.0-dev.2219+eb70f060",
4
4
  "description": "Adapt Fedify with Cloudflare Workers",
5
5
  "keywords": [
6
6
  "Fedify",
@@ -49,7 +49,7 @@
49
49
  ],
50
50
  "peerDependencies": {
51
51
  "@cloudflare/workers-types": "^4.20260511.1",
52
- "@fedify/fedify": "^2.4.0-dev.2212+26ce9858"
52
+ "@fedify/fedify": "^2.4.0-dev.2219+eb70f060"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@cloudflare/vitest-pool-workers": "^0.8.31",