Skip to content

Commit dfbce79

Browse files
committed
fix: provide correct serialization context
instead of context use local variable ctx
1 parent 2eecffb commit dfbce79

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/serialization/Serializer.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ class Serializer {
1616
let current = obj;
1717
for (const middleware of this.serializeMiddlewares) {
1818
if (current && typeof current.then === "function") {
19-
current = current.then(
20-
data => data && middleware.serialize(data, context)
21-
);
19+
current = current.then(data => data && middleware.serialize(data, ctx));
2220
} else if (current) {
2321
try {
2422
current = middleware.serialize(current, ctx);
@@ -36,7 +34,7 @@ class Serializer {
3634
let current = value;
3735
for (const middleware of this.deserializeMiddlewares) {
3836
if (current && typeof current.then === "function") {
39-
current = current.then(data => middleware.deserialize(data, context));
37+
current = current.then(data => middleware.deserialize(data, ctx));
4038
} else {
4139
current = middleware.deserialize(current, ctx);
4240
}

0 commit comments

Comments
 (0)