@vercel/functions
Advanced tools
@@ -35,3 +35,3 @@ "use strict"; | ||
| } | ||
| return entry.value; | ||
| return JSON.parse(entry.value); | ||
| } | ||
@@ -41,4 +41,5 @@ return null; | ||
| async set(key, value, options) { | ||
| const serialized = JSON.stringify(value ?? null); | ||
| this.cache[key] = { | ||
| value, | ||
| value: serialized, | ||
| lastModified: Date.now(), | ||
@@ -45,0 +46,0 @@ ttl: options?.ttl, |
+8
-0
| # @vercel/functions | ||
| ## 3.4.1 | ||
| ### Patch Changes | ||
| - Fix InMemoryCache to use JSON serialization for consistency with RuntimeCache ([#14751](https://github.com/vercel/vercel/pull/14751)) | ||
| InMemoryCache now serializes values with `JSON.stringify()` on set and deserializes with `JSON.parse()` on get, matching the behavior of RuntimeCache. This ensures consistent behavior when switching between cache implementations (e.g., in-memory for development, remote for production), particularly for types that don't survive JSON round-trips like `Date`, `Map`, `Set`, and `undefined`. | ||
| ## 3.4.0 | ||
@@ -4,0 +12,0 @@ |
+1
-1
@@ -33,3 +33,3 @@ { | ||
| }, | ||
| "version": "3.4.0", | ||
| "version": "3.4.1", | ||
| "repository": { | ||
@@ -36,0 +36,0 @@ "directory": "packages/functions", |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 8 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 8 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
152038
0.42%2024
0.05%