Skip to content

Commit 69dbb7b

Browse files
committed
Serialization corrected
1 parent 099685d commit 69dbb7b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/internal/object-serializer.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@ export class ObjectSerializer {
9393
* Deserialize object from json string
9494
*/
9595
public static deserialize(data: any, type: string) {
96-
if (data === undefined || data === null) {
96+
if (data === undefined || data === null)
9797
return data;
98-
// polymorphism may change the actual type.
9998
type = ObjectSerializer.findCorrectType(data, type);
100-
} else if (primitives.indexOf(type.toLowerCase()) !== -1) {
99+
// polymorphism may change the actual type.
100+
if (primitives.indexOf(type.toLowerCase()) !== -1)
101101
return data;
102-
} else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6
102+
if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6
103103
let subType: string = type.replace("Array<", ""); // Array<Type> => Type>
104104
subType = subType.substring(0, subType.length - 1); // Type> => Type
105105
const transformedData = [];

0 commit comments

Comments
 (0)