File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @sablier/deployments" ,
3
3
"description" : " Keeping track of Sablier deployments" ,
4
- "version" : " 1.0.0-alpha.35 " ,
4
+ "version" : " 1.0.0-alpha.36 " ,
5
5
"author" : {
6
6
"name" : " Sablier Labs Ltd" ,
7
7
"url" : " https://sablier.com"
Original file line number Diff line number Diff line change @@ -34,13 +34,15 @@ export const contracts = {
34
34
* Get all contracts for a protocol and chain
35
35
*/
36
36
getAllByProtocolAndChain : ( protocol : Sablier . Protocol , chainId : number ) : Sablier . Contract [ ] | undefined => {
37
- const release = releasesByProtocol [ protocol ] . find ( ( release ) =>
38
- release . deployments . find ( ( deployment ) => deployment . chainId === chainId ) ,
37
+ const releases = releasesByProtocol [ protocol ] ;
38
+ const matchingDeployments = _ . flatMap ( releases , ( release ) =>
39
+ release . deployments . filter ( ( deployment ) => deployment . chainId === chainId ) ,
39
40
) ;
40
- if ( ! release ) {
41
+
42
+ if ( _ . isEmpty ( matchingDeployments ) ) {
41
43
return undefined ;
42
44
}
43
- return release . deployments . flatMap ( ( deployment ) => deployment . contracts ) ;
45
+ return _ . flatMap ( matchingDeployments , ( deployment ) => deployment . contracts ) ;
44
46
} ,
45
47
46
48
/**
You can’t perform that action at this time.
0 commit comments