Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fix: use defaults-deep instead of deep-extend
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobheun authored and daviddias committed Oct 27, 2018
1 parent ec98cd8 commit 4f73f22
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
"cid-tool": "~0.1.0",
"cids": "~0.5.3",
"debug": "^3.1.0",
"deep-extend": "~0.6.0",
"electron-webrtc": "~0.3.0",
"err-code": "^1.1.2",
"file-type": "^8.1.0",
Expand Down
4 changes: 2 additions & 2 deletions src/core/components/pre-start.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const PeerInfo = require('peer-info')
const multiaddr = require('multiaddr')
const waterfall = require('async/waterfall')
const Keychain = require('libp2p-keychain')
const extend = require('deep-extend')
const defaultsDeep = require('@nodeutils/defaults-deep')
const NoKeychain = require('./no-keychain')
/*
* Load stuff from Repo into memory
Expand All @@ -22,7 +22,7 @@ module.exports = function preStart (self) {
return cb(null, config)
}

extend(config, self._options.config)
config = defaultsDeep(self._options.config, config)

self.config.replace(config, (err) => {
if (err) {
Expand Down
6 changes: 3 additions & 3 deletions src/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const PeerBook = require('peer-book')
const multibase = require('multibase')
const CID = require('cids')
const debug = require('debug')
const extend = require('deep-extend')
const defaultsDeep = require('@nodeutils/defaults-deep')
const EventEmitter = require('events')

const config = require('./config')
Expand All @@ -30,7 +30,7 @@ class IPFS extends EventEmitter {
constructor (options) {
super()

this._options = {
const defaults = {
init: true,
start: true,
EXPERIMENTAL: {},
Expand All @@ -45,7 +45,7 @@ class IPFS extends EventEmitter {

options = config.validate(options || {})

extend(this._options, options)
this._options = defaultsDeep(options, defaults)

if (options.init === false) {
this._options.init = false
Expand Down

0 comments on commit 4f73f22

Please sign in to comment.