dexscreener-api
Advanced tools
Comparing version
@@ -51,3 +51,5 @@ "use strict"; | ||
.map((pair) => Number(pair.priceUsd)); | ||
return usdPrices.reduce((previousValue, currentValue) => (previousValue + currentValue)) / usdPrices.length; | ||
if (usdPrices.length === 0) | ||
return 0; | ||
return usdPrices.reduce((previousValue, currentValue) => (previousValue + currentValue), 0) / usdPrices.length; | ||
} | ||
@@ -54,0 +56,0 @@ catch (err) { |
{ | ||
"name": "dexscreener-api", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "A typescript wrapper around the dexscreener API", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
22386
0.27%384
0.52%