Skip to content

Commit

Permalink
fix: decoding objects doesn't work properly from Jest (#186)
Browse files Browse the repository at this point in the history
Update session.ts
  • Loading branch information
ffMathy authored Dec 8, 2023
1 parent 39c5e92 commit f2f4d5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ export class Session {
if (Array.isArray(data)) {
return this._decodeArray(data, identityMap, decodeDatesAsIso);
}
if (typeof data === "object" && data?.constructor === Object) {
if (!!data && typeof data === "object") {
if (data.__entity_type__) {
return this._mergeEntity(data, identityMap, decodeDatesAsIso);
}
Expand Down

0 comments on commit f2f4d5d

Please sign in to comment.