Skip to content

Commit 0c1055a

Browse files
authored
Use default params instead of ||
was keeping it consistent to the rest of the code, but probs best to start doing it more properly.
1 parent 09baf1d commit 0c1055a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/service-module/make-base-model.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,18 +266,18 @@ export default function makeBaseModel(options: FeathersVuexOptions) {
266266
return this._clone(id, data)
267267
}
268268

269-
private _clone(id, data) {
269+
private _clone(id, data = {}) {
270270
const { store, namespace, _commit, _getters } = this
271271
.constructor as typeof BaseModel
272272
const { keepCopiesInStore } = store.state[namespace]
273273

274274
_commit.call(this.constructor, `createCopy`, id)
275275

276276
if (keepCopiesInStore) {
277-
return Object.assign(_getters.call(this.constructor, 'getCopyById', id), data || {})
277+
return Object.assign(_getters.call(this.constructor, 'getCopyById', id), data)
278278
} else {
279279
// const { copiesById } = this.constructor as typeof BaseModel
280-
return Object.assign((this.constructor as typeof BaseModel).copiesById[id], data || {})
280+
return Object.assign((this.constructor as typeof BaseModel).copiesById[id], data)
281281
}
282282
}
283283
/**

0 commit comments

Comments
 (0)