Skip to content

Commit

Permalink
fixed the serailize method that was breaking if we had the wrong type…
Browse files Browse the repository at this point in the history
… for an integer that was typed a string
  • Loading branch information
SerKnight committed May 8, 2020
1 parent ad7a784 commit fc6c2f6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,8 @@
"**/.git": true,
"**/.DS_Store": true,
".tsconfig.tsbuildinfo": true
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xero-node",
"version": "4.4.9",
"version": "4.5.2",
"description": "Xero NodeJS OAuth 2.0 client for xero-node",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/gen/model/accounting/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ export class ObjectSerializer {
if (data == undefined) {
return data;
} else if (primitives.indexOf(type.toLowerCase()) !== -1) {
if (type === "string" && data.substring(0, 6) === "/Date(") {
if (type === "string" && data.toString().substring(0, 6) === "/Date(") {
return this.deserializeDateFormats(type, data) // For MS dates that are of type 'string'
}
else {
Expand Down
2 changes: 1 addition & 1 deletion src/gen/model/assets/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export class ObjectSerializer {
if (data == undefined) {
return data;
} else if (primitives.indexOf(type.toLowerCase()) !== -1) {
if (type === "string" && data.substring(0, 6) === "/Date(") {
if (type === "string" && data.toString().substring(0, 6) === "/Date(") {
return this.deserializeDateFormats(type, data) // For MS dates that are of type 'string'
}
else {
Expand Down
2 changes: 1 addition & 1 deletion src/gen/model/projects/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export class ObjectSerializer {
if (data == undefined) {
return data;
} else if (primitives.indexOf(type.toLowerCase()) !== -1) {
if (type === "string" && data.substring(0, 6) === "/Date(") {
if (type === "string" && data.toString().substring(0, 6) === "/Date(") {
return this.deserializeDateFormats(type, data) // For MS dates that are of type 'string'
}
else {
Expand Down

0 comments on commit fc6c2f6

Please sign in to comment.