@clov-std/elysia-cache 1.0.0 → 1.0.2

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/README.md +6 -5
  2. package/package.json +10 -10
package/README.md CHANGED
@@ -112,7 +112,8 @@ new Elysia()
112
112
  {
113
113
  isCached: {
114
114
  ttl: 60,
115
- keyGenerator: (request, body) => generateCacheKey(request, body, ['accept-language'])
115
+ keyGenerator: (request, body) =>
116
+ generateCacheKey(request, body, ['accept-language'])
116
117
  }
117
118
  },
118
119
  () => listItems()
@@ -140,10 +141,10 @@ Builds the key for a request: `method:url`, the `vary` header values, then the p
140
141
 
141
142
  ### `CacheOptions`
142
143
 
143
- | Option | Type | Default | Description |
144
- | -------------- | --------------------------------------------------------------------------------- | ---------------------------------------------- | --------------------------------------------------------------------------- |
145
- | `ttl` | `number` | - | Time to live, in seconds. |
146
- | `vary` | `string[]` | `['authorization']` | Header names included in the key. |
144
+ | Option | Type | Default | Description |
145
+ | -------------- | ------------------------------------------------------------------------------------------ | --------------------------------------- | -------------------------------------------------------------------------- |
146
+ | `ttl` | `number` | - | Time to live, in seconds. |
147
+ | `vary` | `string[]` | `['authorization']` | Header names included in the key. |
147
148
  | `keyGenerator` | `(request: Request, body: unknown) => string \| undefined \| Promise<string \| undefined>` | `generateCacheKey(request, body, vary)` | Custom key builder. Returning `undefined` opts the request out of caching. |
148
149
 
149
150
  Full docs: [https://clovlabs.github.io/std/](https://clovlabs.github.io/std/)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clov-std/elysia-cache",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Cache plugin for Elysia framework.",
5
5
  "keywords": [
6
6
  "bun",
@@ -17,7 +17,7 @@
17
17
  "repository": {
18
18
  "type": "git",
19
19
  "url": "git+https://github.com/ClovLabs/std.git",
20
- "directory": "packages/elysia-rcache"
20
+ "directory": "packages/elysia-cache"
21
21
  },
22
22
  "files": [
23
23
  "dist"
@@ -40,18 +40,18 @@
40
40
  "test": "bun test --pass-with-no-tests --coverage"
41
41
  },
42
42
  "dependencies": {
43
- "@clov-std/kv-store": "workspace:^"
43
+ "@clov-std/kv-store": "^2.0.1"
44
44
  },
45
45
  "devDependencies": {
46
- "@types/bun": "catalog:base",
47
- "oxfmt": "catalog:base",
48
- "oxlint": "catalog:base",
49
- "oxlint-tsgolint": "catalog:base",
50
- "typescript": "catalog:base"
46
+ "@types/bun": "^1.4.2",
47
+ "oxfmt": "0.68.0",
48
+ "oxlint": "1.83.0",
49
+ "oxlint-tsgolint": "7.0.2002",
50
+ "typescript": "^7.0.2"
51
51
  },
52
52
  "peerDependencies": {
53
- "@clov-std/kv-store": "workspace:^",
53
+ "@clov-std/kv-store": "^2.0.1",
54
54
  "elysia": "next",
55
- "typebox": "^1.3.11"
55
+ "typebox": "^1.3.34"
56
56
  }
57
57
  }