Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit 5ee2a13

Browse files
chore(eslint): fix backbone.validation to not use undefined
1 parent b654f82 commit 5ee2a13

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

js/models/serverConfigMd.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ module.exports = Backbone.Model.extend({
8282
}
8383
}
8484

85-
return Object.keys(err).length && err || undefined;
85+
if (Object.keys(err).length > 0) {
86+
return err;
87+
}
8688
},
8789

8890
getServerBaseUrl: function() {

js/models/statusMessageMd.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ module.exports = window.Backbone.Model.extend({
2525
err['msg'] = 'Msg is required and must be a string.';
2626
}
2727

28-
return Object.keys(err).length && err || undefined;
28+
if (Object.keys(err).length > 0) {
29+
return err;
30+
}
2931
}
30-
});
32+
});

0 commit comments

Comments
 (0)