@vercel/functions 2.0.1 → 2.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @vercel/functions
2
2
 
3
+ ## 2.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Update in memory cache to use a singleton instance ([#13288](https://github.com/vercel/vercel/pull/13288))
8
+
3
9
  ## 2.0.1
4
10
 
5
11
  ### Patch Changes
package/cache/index.js CHANGED
@@ -31,12 +31,16 @@ const defaultKeyHashFunction = (key) => {
31
31
  return (hash >>> 0).toString(16);
32
32
  };
33
33
  const defaultNamespaceSeparator = "$";
34
+ let inMemoryCacheInstance = null;
34
35
  const getFunctionCache = (cacheOptions) => {
35
36
  let cache;
36
37
  if ((0, import_get_context.getContext)().cache) {
37
38
  cache = (0, import_get_context.getContext)().cache;
38
39
  } else {
39
- cache = new import_in_memory_cache.InMemoryCache();
40
+ if (!inMemoryCacheInstance) {
41
+ inMemoryCacheInstance = new import_in_memory_cache.InMemoryCache();
42
+ }
43
+ cache = inMemoryCacheInstance;
40
44
  }
41
45
  const hashFunction = cacheOptions?.keyHashFunction || defaultKeyHashFunction;
42
46
  const makeKey = (key) => {
@@ -40,7 +40,7 @@ Omit.clientConfig
40
40
 
41
41
  #### Defined in
42
42
 
43
- node*modules/.pnpm/@aws-sdk+credential-provider-web-identity@3.609.0*@aws-sdk+client-sts@3.731.1/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/fromWebToken.d.ts:135
43
+ node*modules/.pnpm/@aws-sdk+credential-provider-web-identity@3.609.0*@aws-sdk+client-sts@3.803.0/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/fromWebToken.d.ts:135
44
44
 
45
45
  ---
46
46
 
@@ -56,7 +56,7 @@ Omit.clientPlugins
56
56
 
57
57
  #### Defined in
58
58
 
59
- node*modules/.pnpm/@aws-sdk+credential-provider-web-identity@3.609.0*@aws-sdk+client-sts@3.731.1/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/fromWebToken.d.ts:139
59
+ node*modules/.pnpm/@aws-sdk+credential-provider-web-identity@3.609.0*@aws-sdk+client-sts@3.803.0/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/fromWebToken.d.ts:139
60
60
 
61
61
  ---
62
62
 
@@ -202,7 +202,7 @@ Omit.roleAssumerWithWebIdentity
202
202
 
203
203
  #### Defined in
204
204
 
205
- node*modules/.pnpm/@aws-sdk+credential-provider-web-identity@3.609.0*@aws-sdk+client-sts@3.731.1/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/fromWebToken.d.ts:130
205
+ node*modules/.pnpm/@aws-sdk+credential-provider-web-identity@3.609.0*@aws-sdk+client-sts@3.803.0/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/fromWebToken.d.ts:130
206
206
 
207
207
  ---
208
208
 
@@ -218,4 +218,4 @@ Omit.roleSessionName
218
218
 
219
219
  #### Defined in
220
220
 
221
- node*modules/.pnpm/@aws-sdk+credential-provider-web-identity@3.609.0*@aws-sdk+client-sts@3.731.1/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/fromWebToken.d.ts:123
221
+ node*modules/.pnpm/@aws-sdk+credential-provider-web-identity@3.609.0*@aws-sdk+client-sts@3.803.0/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/fromWebToken.d.ts:123
@@ -149,7 +149,7 @@ An instance of the Vercel Function Cache.
149
149
 
150
150
  #### Defined in
151
151
 
152
- [packages/functions/src/cache/index.ts:29](https://github.com/vercel/vercel/blob/main/packages/functions/src/cache/index.ts#L29)
152
+ [packages/functions/src/cache/index.ts:32](https://github.com/vercel/vercel/blob/main/packages/functions/src/cache/index.ts#L32)
153
153
 
154
154
  ---
155
155
 
package/package.json CHANGED
@@ -26,7 +26,7 @@
26
26
  "require": "./middleware.js"
27
27
  }
28
28
  },
29
- "version": "2.0.1",
29
+ "version": "2.0.2",
30
30
  "repository": {
31
31
  "directory": "packages/functions",
32
32
  "type": "git",