Skip to content

Commit 2c67024

Browse files
committed
refactor(model): simplify some checks
1 parent 29e66ea commit 2c67024

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/Model.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export default class Model extends StaticModel {
107107
let url = `${this.baseURL()}`;
108108

109109
args.forEach(object => {
110-
if (object instanceof Model === false) {
110+
if (!(object instanceof Model)) {
111111
throw new Error('The object referenced on for() method is not a valid Model.')
112112
}
113113

@@ -139,7 +139,7 @@ export default class Model extends StaticModel {
139139
}
140140

141141
isValidId(id) {
142-
return id !== undefined && id !== 0 && id !== '' && id !== null
142+
return !!id
143143
}
144144

145145
endpoint() {

0 commit comments

Comments
 (0)