mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
shortened find()
This commit is contained in:
parent
17e6540031
commit
18f0dd7040
@ -38,9 +38,7 @@ export default class DDO {
|
|||||||
throw new Error("serviceDefinitionId not set")
|
throw new Error("serviceDefinitionId not set")
|
||||||
}
|
}
|
||||||
|
|
||||||
const service: Service = this.service.find((s) => {
|
const service: Service = this.service.find((s) => s.serviceDefinitionId === serviceDefinitionId)
|
||||||
return s.serviceDefinitionId === serviceDefinitionId
|
|
||||||
})
|
|
||||||
|
|
||||||
return service
|
return service
|
||||||
}
|
}
|
||||||
@ -51,9 +49,7 @@ export default class DDO {
|
|||||||
throw new Error("serviceType not set")
|
throw new Error("serviceType not set")
|
||||||
}
|
}
|
||||||
|
|
||||||
const service: Service = this.service.find((s) => {
|
const service: Service = this.service.find((s) => s.type === serviceType)
|
||||||
return s.type === serviceType
|
|
||||||
})
|
|
||||||
|
|
||||||
return service
|
return service
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user