Skip to content

Commit

Permalink
refactor(model): use defu instead of merge
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaoPedroAS51 committed May 29, 2021
1 parent 5c0bf1c commit b13bcae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Model.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import defu from 'defu'
import getProp from 'dotprop'
import setProp from 'dset'
import merge from 'merge'
import { serialize } from 'object-to-formdata'

import Builder from './Builder'
Expand Down Expand Up @@ -306,8 +306,8 @@ export default class Model extends StaticModel {
}

_reqConfig(config, options = { forceMethod: false }) {
// Merge cloned config to prevent changing the original config objects
const _config = merge.recursive({ ...config }, { ...this._config })
// Merge config, recursively. Leftmost arguments have more priority.
const _config = defu(this._config, config)

// Prevent default request method from being overridden
if (options.forceMethod) {
Expand Down

0 comments on commit b13bcae

Please sign in to comment.