Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
0x3bfc committed Jun 17, 2020
1 parent 92005c6 commit de09819
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 22 deletions.
24 changes: 12 additions & 12 deletions src/aquarius/Aquarius.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
})
Expand Down Expand Up @@ -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()
})
Expand Down Expand Up @@ -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
})
Expand Down Expand Up @@ -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
})
Expand Down Expand Up @@ -253,7 +253,7 @@ export class Aquarius {
return null
})

.catch(error => {
.catch((error) => {
this.logger.error('Error transfering ownership metadata: ', error)
return null
})
Expand Down Expand Up @@ -307,7 +307,7 @@ export class Aquarius {
return null
})

.catch(error => {
.catch((error) => {
this.logger.error('Error updating compute privacy: ', error)
return null
})
Expand Down Expand Up @@ -353,7 +353,7 @@ export class Aquarius {
return null
})

.catch(error => {
.catch((error) => {
this.logger.error('Error transfering ownership metadata: ', error)
return null
})
Expand Down Expand Up @@ -391,7 +391,7 @@ export class Aquarius {
return null
})

.catch(error => {
.catch((error) => {
this.logger.error('Error transfering ownership metadata: ', error)
return null
})
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/ddo/DDO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>
}
Expand All @@ -87,7 +87,7 @@ export class DDO {
throw new Error('serviceType not set')
}

return this.service.find(s => s.type === serviceType) as Service<T>
return this.service.find((s) => s.type === serviceType) as Service<T>
}

/**
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/ocean/Accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions src/ocean/Assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class Assets extends Instantiable {
dtAddress?: string
): SubscribablePromise<CreateProgressStep, DDO> {
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?')
}
Expand Down Expand Up @@ -148,7 +148,7 @@ export class Assets extends Instantiable {
)
.reverse()
// Adding index
.map(_ => ({
.map((_) => ({
..._,
index: indexCount++
})) as Service[]
Expand Down
2 changes: 1 addition & 1 deletion src/utils/ConfigHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/utils/SubscribableObserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class SubscribableObserver<T, P> {

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))
}
Expand Down
4 changes: 2 additions & 2 deletions src/utils/SubscribablePromise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ export class SubscribablePromise<T extends any, P extends any> {
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)
}
Expand Down

0 comments on commit de09819

Please sign in to comment.