This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree 3 files changed +5
-6
lines changed 3 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 88
88
"cid-tool" : " ~0.1.0" ,
89
89
"cids" : " ~0.5.3" ,
90
90
"debug" : " ^3.1.0" ,
91
- "deep-extend" : " ~0.6.0" ,
92
91
"electron-webrtc" : " ~0.3.0" ,
93
92
"err-code" : " ^1.1.2" ,
94
93
"file-type" : " ^8.1.0" ,
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ const PeerInfo = require('peer-info')
5
5
const multiaddr = require ( 'multiaddr' )
6
6
const waterfall = require ( 'async/waterfall' )
7
7
const Keychain = require ( 'libp2p-keychain' )
8
- const extend = require ( 'deep-extend ' )
8
+ const defaultsDeep = require ( '@nodeutils/defaults-deep ' )
9
9
const NoKeychain = require ( './no-keychain' )
10
10
/*
11
11
* Load stuff from Repo into memory
@@ -22,7 +22,7 @@ module.exports = function preStart (self) {
22
22
return cb ( null , config )
23
23
}
24
24
25
- extend ( config , self . _options . config )
25
+ config = defaultsDeep ( self . _options . config , config )
26
26
27
27
self . config . replace ( config , ( err ) => {
28
28
if ( err ) {
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ const PeerBook = require('peer-book')
14
14
const multibase = require ( 'multibase' )
15
15
const CID = require ( 'cids' )
16
16
const debug = require ( 'debug' )
17
- const extend = require ( 'deep-extend ' )
17
+ const defaultsDeep = require ( '@nodeutils/defaults-deep ' )
18
18
const EventEmitter = require ( 'events' )
19
19
20
20
const config = require ( './config' )
@@ -30,7 +30,7 @@ class IPFS extends EventEmitter {
30
30
constructor ( options ) {
31
31
super ( )
32
32
33
- this . _options = {
33
+ const defaults = {
34
34
init : true ,
35
35
start : true ,
36
36
EXPERIMENTAL : { } ,
@@ -45,7 +45,7 @@ class IPFS extends EventEmitter {
45
45
46
46
options = config . validate ( options || { } )
47
47
48
- extend ( this . _options , options )
48
+ this . _options = defaultsDeep ( options , defaults )
49
49
50
50
if ( options . init === false ) {
51
51
this . _options . init = false
You can’t perform that action at this time.
0 commit comments