convert from ? notation to more concise || notation
This commit is contained in:
parent
c1ff96ab1b
commit
34f30e88ea
1 changed files with 9 additions and 9 deletions
18
API.js
18
API.js
|
|
@ -7,26 +7,26 @@ var API = function(opts) {
|
|||
API.prototype._init = function(opts) {
|
||||
var self = this;
|
||||
|
||||
opts = opts ? opts : {};
|
||||
opts = opts || {};
|
||||
self.opts = opts;
|
||||
|
||||
var Wallet = require('soop').load('./js/models/core/Wallet', {
|
||||
Storage: opts.Storage ? opts.Storage : require('./test/FakeStorage'),
|
||||
Network: opts.Network ? opts.Network : require('./js/models/Network/WebRTC'),
|
||||
Blockchain: opts.Blockchain ? opts.Blockchain : require('./js/models/Blockchain/Insight')
|
||||
Storage: opts.Storage || require('./test/FakeStorage'),
|
||||
Network: opts.Network || require('./js/models/Network/WebRTC'),
|
||||
Blockchain: opts.Blockchain || require('./js/models/Blockchain/Insight')
|
||||
});
|
||||
|
||||
var config = {
|
||||
wallet: {
|
||||
requiredCopayers: opts.requiredCopayers ? opts.requiredCopayers : 3,
|
||||
totalCopayers: opts.totalCopayers ? opts.totalCopayers : 5,
|
||||
requiredCopayers: opts.requiredCopayers || 3,
|
||||
totalCopayers: opts.totalCopayers || 5,
|
||||
}
|
||||
};
|
||||
|
||||
var walletConfig = opts.walletConfig ? opts.walletConfig : config;
|
||||
var walletOpts = opts.walletOpts ? opts.walletOpts : {};
|
||||
var walletConfig = opts.walletConfig || config;
|
||||
var walletOpts = opts.walletOpts || {};
|
||||
|
||||
self.wallet = self.opts.wallet ? self.opts.wallet : Wallet.factory.create(walletConfig, walletOpts);
|
||||
self.wallet = self.opts.wallet || Wallet.factory.create(walletConfig, walletOpts);
|
||||
};
|
||||
|
||||
API._coerceArgTypes = function(args, argTypes) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue