@vercel/functions 3.4.2 → 3.4.3
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 +6 -0
- package/cache/index.js +2 -21
- package/docs/modules/index.md +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/cache/index.js
CHANGED
|
@@ -37,21 +37,6 @@ const defaultKeyHashFunction = (key) => {
|
|
|
37
37
|
return (hash >>> 0).toString(16);
|
|
38
38
|
};
|
|
39
39
|
const defaultNamespaceSeparator = "$";
|
|
40
|
-
function encodeTags(tags) {
|
|
41
|
-
return tags.map(encodeURIComponent);
|
|
42
|
-
}
|
|
43
|
-
function encodeTag(tag) {
|
|
44
|
-
return Array.isArray(tag) ? encodeTags(tag) : encodeURIComponent(tag);
|
|
45
|
-
}
|
|
46
|
-
function encodeOptions(options) {
|
|
47
|
-
if (!options) {
|
|
48
|
-
return void 0;
|
|
49
|
-
}
|
|
50
|
-
if (options.tags && options.tags.length > 0) {
|
|
51
|
-
return { ...options, tags: encodeTags(options.tags) };
|
|
52
|
-
}
|
|
53
|
-
return options;
|
|
54
|
-
}
|
|
55
40
|
let inMemoryCacheInstance = null;
|
|
56
41
|
let buildCacheInstance = null;
|
|
57
42
|
const getCache = (cacheOptions) => {
|
|
@@ -86,17 +71,13 @@ function wrapWithKeyTransformation(resolveCache, makeKey) {
|
|
|
86
71
|
return resolveCache().get(makeKey(key));
|
|
87
72
|
},
|
|
88
73
|
set: (key, value, options) => {
|
|
89
|
-
|
|
90
|
-
if (encodedOptions) {
|
|
91
|
-
return resolveCache().set(makeKey(key), value, encodedOptions);
|
|
92
|
-
}
|
|
93
|
-
return resolveCache().set(makeKey(key), value);
|
|
74
|
+
return resolveCache().set(makeKey(key), value, options);
|
|
94
75
|
},
|
|
95
76
|
delete: (key) => {
|
|
96
77
|
return resolveCache().delete(makeKey(key));
|
|
97
78
|
},
|
|
98
79
|
expireTag: (tag) => {
|
|
99
|
-
return resolveCache().expireTag(
|
|
80
|
+
return resolveCache().expireTag(tag);
|
|
100
81
|
}
|
|
101
82
|
};
|
|
102
83
|
}
|
package/docs/modules/index.md
CHANGED
|
@@ -261,7 +261,7 @@ An instance of the Vercel Runtime Cache.
|
|
|
261
261
|
|
|
262
262
|
#### Defined in
|
|
263
263
|
|
|
264
|
-
[packages/functions/src/cache/index.ts:
|
|
264
|
+
[packages/functions/src/cache/index.ts:33](https://github.com/vercel/vercel/blob/main/packages/functions/src/cache/index.ts#L33)
|
|
265
265
|
|
|
266
266
|
---
|
|
267
267
|
|