From de09819278d861d1ee51d89ae62cf3f103646fc7 Mon Sep 17 00:00:00 2001 From: Ahmed Ali Date: Wed, 17 Jun 2020 10:02:12 +0200 Subject: [PATCH] fix lint errors --- src/aquarius/Aquarius.ts | 24 ++++++++++++------------ src/ddo/DDO.ts | 6 +++--- src/ocean/Accounts.ts | 2 +- src/ocean/Assets.ts | 4 ++-- src/utils/ConfigHelper.ts | 2 +- src/utils/SubscribableObserver.ts | 2 +- src/utils/SubscribablePromise.ts | 4 ++-- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/aquarius/Aquarius.ts b/src/aquarius/Aquarius.ts index a96b3211b..467495993 100644 --- a/src/aquarius/Aquarius.ts +++ b/src/aquarius/Aquarius.ts @@ -64,7 +64,7 @@ export class Aquarius { this.logger.error('Success accessing consume endpoint: ', consumptionUrl) return consumptionUrl }) - .catch(error => { + .catch((error) => { this.logger.error( 'Error fetching the data asset consumption url: ', error @@ -94,10 +94,10 @@ export class Aquarius { ) return this.transformResult() }) - .then(results => { + .then((results) => { return this.transformResult(results) }) - .catch(error => { + .catch((error) => { this.logger.error('Error fetching querying metadata: ', error) return this.transformResult() }) @@ -133,10 +133,10 @@ export class Aquarius { ) return this.transformResult() }) - .then(results => { + .then((results) => { return this.transformResult(results) }) - .catch(error => { + .catch((error) => { this.logger.error('Error fetching querying metadata by text: ', error) return this.transformResult() }) @@ -168,7 +168,7 @@ export class Aquarius { .then((response: DDO) => { return new DDO(response) as DDO }) - .catch(error => { + .catch((error) => { this.logger.error('Error fetching querying metadata: ', error) return null as DDO }) @@ -204,7 +204,7 @@ export class Aquarius { .then((response: DDO) => { return new DDO(response) as DDO }) - .catch(error => { + .catch((error) => { this.logger.error('Error fetching querying metadata: ', error) return null as DDO }) @@ -253,7 +253,7 @@ export class Aquarius { return null }) - .catch(error => { + .catch((error) => { this.logger.error('Error transfering ownership metadata: ', error) return null }) @@ -307,7 +307,7 @@ export class Aquarius { return null }) - .catch(error => { + .catch((error) => { this.logger.error('Error updating compute privacy: ', error) return null }) @@ -353,7 +353,7 @@ export class Aquarius { return null }) - .catch(error => { + .catch((error) => { this.logger.error('Error transfering ownership metadata: ', error) return null }) @@ -391,7 +391,7 @@ export class Aquarius { return null }) - .catch(error => { + .catch((error) => { this.logger.error('Error transfering ownership metadata: ', error) return null }) @@ -416,7 +416,7 @@ export class Aquarius { } ): QueryResult { return { - results: (results || []).map(ddo => new DDO(ddo as DDO)), + results: (results || []).map((ddo) => new DDO(ddo as DDO)), page, totalPages, totalResults diff --git a/src/ddo/DDO.ts b/src/ddo/DDO.ts index 2427e1dd1..4c3ad3775 100644 --- a/src/ddo/DDO.ts +++ b/src/ddo/DDO.ts @@ -72,7 +72,7 @@ export class DDO { throw new Error('index is not set') } - const service = this.service.find(s => s.index === index) + const service = this.service.find((s) => s.index === index) return service as Service } @@ -87,7 +87,7 @@ export class DDO { throw new Error('serviceType not set') } - return this.service.find(s => s.type === serviceType) as Service + return this.service.find((s) => s.type === serviceType) as Service } /** @@ -100,7 +100,7 @@ export class DDO { const { files, name, author, license } = attributes.main const values = [ - ...(files || []).map(({ checksum }) => checksum).filter(_ => !!_), + ...(files || []).map(({ checksum }) => checksum).filter((_) => !!_), name, author, license, diff --git a/src/ocean/Accounts.ts b/src/ocean/Accounts.ts index 8ff6a7311..041a69bad 100644 --- a/src/ocean/Accounts.ts +++ b/src/ocean/Accounts.ts @@ -25,7 +25,7 @@ export class Accounts extends Instantiable { const ethAccounts: string[] = await this.web3.eth.getAccounts() const accountPromises = ethAccounts.map( - address => new Account(address, this.instanceConfig) + (address) => new Account(address, this.instanceConfig) ) return Promise.all(accountPromises) } diff --git a/src/ocean/Assets.ts b/src/ocean/Assets.ts index c6d2d9647..bb5352d17 100644 --- a/src/ocean/Assets.ts +++ b/src/ocean/Assets.ts @@ -69,7 +69,7 @@ export class Assets extends Instantiable { dtAddress?: string ): SubscribablePromise { this.logger.log('Creating asset') - return new SubscribablePromise(async observer => { + return new SubscribablePromise(async (observer) => { if (services.length === 0) { this.logger.log('You have no services. Are you sure about this?') } @@ -148,7 +148,7 @@ export class Assets extends Instantiable { ) .reverse() // Adding index - .map(_ => ({ + .map((_) => ({ ..._, index: indexCount++ })) as Service[] diff --git a/src/utils/ConfigHelper.ts b/src/utils/ConfigHelper.ts index c2129a8ac..69b5afcc2 100644 --- a/src/utils/ConfigHelper.ts +++ b/src/utils/ConfigHelper.ts @@ -25,7 +25,7 @@ export class ConfigHelper { confighelp.factoryAddress = null confighelp.url = null confighelp.network = network - const knownconfig = configs.find(c => c.network === network) + const knownconfig = configs.find((c) => c.network === network) if (knownconfig) { confighelp.factoryAddress = knownconfig.factoryAddress confighelp.url = knownconfig.url diff --git a/src/utils/SubscribableObserver.ts b/src/utils/SubscribableObserver.ts index efeb41167..9e9160541 100644 --- a/src/utils/SubscribableObserver.ts +++ b/src/utils/SubscribableObserver.ts @@ -39,7 +39,7 @@ export class SubscribableObserver { private emit(type: 'onNext' | 'onComplete' | 'onError', value: any) { Array.from(this.subscriptions) - .map(subscription => subscription[type]) + .map((subscription) => subscription[type]) .filter((callback: any) => callback && typeof callback === 'function') .forEach((callback: any) => callback(value)) } diff --git a/src/utils/SubscribablePromise.ts b/src/utils/SubscribablePromise.ts index 1ff71fb13..ee4b0acb0 100644 --- a/src/utils/SubscribablePromise.ts +++ b/src/utils/SubscribablePromise.ts @@ -42,12 +42,12 @@ export class SubscribablePromise { const execution = executor(this.observer) Promise.resolve(execution as any) - .then(result => { + .then((result) => { if (typeof (execution as any).then === 'function') { this.observer.complete(result) } }) - .catch(result => { + .catch((result) => { if (typeof (execution as any).then === 'function') { this.observer.error(result) }