Skip to content
This repository was archived by the owner on Jan 31, 2025. It is now read-only.

Commit 8baf3fb

Browse files
author
Daniel Brain
committed
Cleanup
1 parent 99d5e2c commit 8baf3fb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/lib/serialize.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -159,16 +159,19 @@ export function deserializePromise(source : any, origin : string, prom : Object)
159159
export function deserializeMethods(source : any, origin : string, obj : Object) : Object {
160160

161161
return replaceObject({ obj }, (item, key) => {
162+
if (typeof item !== 'object' || item === null) {
163+
return;
164+
}
162165

163-
if (typeof item === 'object' && item !== null && isSerialized(item, CONSTANTS.SERIALIZATION_TYPES.METHOD)) {
166+
if (isSerialized(item, CONSTANTS.SERIALIZATION_TYPES.METHOD)) {
164167
return deserializeMethod(source, origin, item);
165168
}
166169

167-
if (typeof item === 'object' && item !== null && isSerialized(item, CONSTANTS.SERIALIZATION_TYPES.ERROR)) {
170+
if (isSerialized(item, CONSTANTS.SERIALIZATION_TYPES.ERROR)) {
168171
return deserializeError(source, origin, item);
169172
}
170173

171-
if (typeof item === 'object' && item !== null && isSerialized(item, CONSTANTS.SERIALIZATION_TYPES.PROMISE)) {
174+
if (isSerialized(item, CONSTANTS.SERIALIZATION_TYPES.PROMISE)) {
172175
return deserializePromise(source, origin, item);
173176
}
174177

0 commit comments

Comments
 (0)