File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @snapshot-labs/snapshot.js" ,
3
- "version" : " 0.5.2 " ,
3
+ "version" : " 0.5.3 " ,
4
4
"repository" : " snapshot-labs/snapshot.js" ,
5
5
"license" : " MIT" ,
6
6
"main" : " dist/snapshot.cjs.js" ,
Original file line number Diff line number Diff line change @@ -222,7 +222,6 @@ export async function getScores(
222
222
scoreApiUrl = 'https://score.snapshot.org' ,
223
223
options : any = { }
224
224
) {
225
- if ( ! options . returnValue ) options . returnValue = 'scores' ;
226
225
const url = new URL ( scoreApiUrl ) ;
227
226
url . pathname = '/api/scores' ;
228
227
scoreApiUrl = url . toString ( ) ;
@@ -241,7 +240,9 @@ export async function getScores(
241
240
body : JSON . stringify ( { params } )
242
241
} ) ;
243
242
const obj = await res . json ( ) ;
244
- return options . returnValue ? obj . result [ options . returnValue ] : obj . result ;
243
+ return options . returnValue === 'all'
244
+ ? obj . result
245
+ : obj . result [ options . returnValue || 'scores' ] ;
245
246
} catch ( e ) {
246
247
return Promise . reject ( e ) ;
247
248
}
You can’t perform that action at this time.
0 commit comments