🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@vercel/functions

Package Overview
Dependencies
Maintainers
2
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vercel/functions - npm Package Compare versions

Comparing version
3.4.0
to
3.4.1
+3
-2
cache/in-memory-cache.js

@@ -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,

# @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",