Cleanup Codeclimate smells (#11)

* Cleanup Codeclimate smells

* Add Codeclimate badges
This commit is contained in:
Jaco Greeff
2018-12-08 16:37:05 +01:00
committed by GitHub
parent 9aaea82544
commit 91db30af82
11 changed files with 134 additions and 140 deletions
+2 -3
View File
@@ -7,6 +7,7 @@ import { SingleAddress } from '../observable/types';
import { KeyringOptions, KeyringOptionInstance, KeyringSectionOption, KeyringSectionOptions } from './types';
import { BehaviorSubject } from 'rxjs';
import { assert } from '@polkadot/util';
import observableAll from '../observable';
@@ -26,9 +27,7 @@ class KeyringOption implements KeyringOptionInstance {
}
init (keyring: KeyringStruct): void {
if (hasCalledInitOptions) {
throw new Error('Unable to initialise options more than once');
}
assert(!hasCalledInitOptions, 'Unable to initialise options more than once');
observableAll.subscribe((value) => {
const options = this.emptyOptions();