Skip to content

Commit

Permalink
fix typescript error type string rates cannot be a number, fix an obj…
Browse files Browse the repository at this point in the history
…ect only can have a key with the same name
  • Loading branch information
Alan966 committed Mar 25, 2024
1 parent 59ac31b commit b3c84aa
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ class CurrencyConverter {
"FCFA": "Central African CFA Franc",
"CLP": "Chilean Peso",
"CLF": "Chilean Unit of Account (UF)",
"CNY": "Chinese Yuan",
"CNY": "Chinese Yuan (offshore)",
"CNY": ["Chinese Yuan", "Chinese Yuan (offshore)"],
"COP": "Colombian Peso",
"KMF": "Comorian Franc",
"CDF": "Congolese Franc",
Expand Down Expand Up @@ -294,11 +293,11 @@ class CurrencyConverter {
if (rates.includes(","))
rates = this.replaceAll(rates, ",", "")
}
rates = parseFloat(rates) / this.currencyAmount
const rates_number = rates = parseFloat(rates) / this.currencyAmount
if (this.isRatesCaching) {
this.addRateToRatesCache(currencyPair, rates);
this.addRateToRatesCache(currencyPair, rates_number);
}
return rates
return rates_number;
})
}
}
Expand Down

0 comments on commit b3c84aa

Please sign in to comment.