Skip to content

Commit

Permalink
code type (early return, should have been continue in loop)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielweck committed Nov 21, 2019
1 parent 3b68e85 commit 3114f2d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/models/serializable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ export function generateAdditionalJSON(obj: IWithAdditionalJSON, json: JsonMap)
}
const keys = Object.keys(obj.AdditionalJSON);
for (const key of keys) {
if (obj.SupportedKeys && obj.SupportedKeys.includes(key)) {
return;
}
if (obj.AdditionalJSON.hasOwnProperty(key)) {
if (obj.SupportedKeys && obj.SupportedKeys.includes(key)) {
continue;
}
// warning: reference copy, not deep clone!
json[key] = obj.AdditionalJSON[key];
}
Expand Down

0 comments on commit 3114f2d

Please sign in to comment.