mirror of https://github.com/BTCPrivate/copay.git
lint: reenable tslint no-string-throw, fix issues
This commit is contained in:
parent
e55dfe42d4
commit
83f91bc3a7
|
@ -32,7 +32,7 @@ export class Profile {
|
||||||
x.checkedUA = obj.checkedUA || {};
|
x.checkedUA = obj.checkedUA || {};
|
||||||
|
|
||||||
if (x.credentials[0] && typeof x.credentials[0] != 'object')
|
if (x.credentials[0] && typeof x.credentials[0] != 'object')
|
||||||
throw ("credentials should be an object");
|
throw new Error("credentials should be an object");
|
||||||
return x;
|
return x;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ export class Profile {
|
||||||
|
|
||||||
public addWallet(credentials: any): boolean {
|
public addWallet(credentials: any): boolean {
|
||||||
if (!credentials.walletId)
|
if (!credentials.walletId)
|
||||||
throw 'credentials must have .walletId';
|
throw new Error('credentials must have .walletId');
|
||||||
|
|
||||||
if (this.hasWallet(credentials.walletId))
|
if (this.hasWallet(credentials.walletId))
|
||||||
return false;
|
return false;
|
||||||
|
@ -86,7 +86,7 @@ export class Profile {
|
||||||
|
|
||||||
public updateWallet(credentials: any): boolean {
|
public updateWallet(credentials: any): boolean {
|
||||||
if (!credentials.walletId)
|
if (!credentials.walletId)
|
||||||
throw 'credentials must have .walletId';
|
throw new Error('credentials must have .walletId');
|
||||||
|
|
||||||
if (!this.hasWallet(credentials.walletId))
|
if (!this.hasWallet(credentials.walletId))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -937,7 +937,7 @@ export class ProfileProvider {
|
||||||
|
|
||||||
public getWallets(opts?: any) {
|
public getWallets(opts?: any) {
|
||||||
|
|
||||||
if (opts && !_.isObject(opts)) throw "bad argument";
|
if (opts && !_.isObject(opts)) throw new Error("bad argument");
|
||||||
|
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,6 @@
|
||||||
"curly": false,
|
"curly": false,
|
||||||
"object-literal-shorthand": false,
|
"object-literal-shorthand": false,
|
||||||
"member-access": false,
|
"member-access": false,
|
||||||
"no-string-throw": false,
|
|
||||||
"arrow-return-shorthand": false,
|
"arrow-return-shorthand": false,
|
||||||
"array-type": false
|
"array-type": false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue