From 3ac670c174edbb7451a70c005c74baf0fc38ba73 Mon Sep 17 00:00:00 2001 From: David Sanchez | Principal DevOps Consultant Date: Mon, 20 Nov 2023 16:39:41 -0500 Subject: [PATCH] Fixing issues of the npm package. Resolves #21 update to 2.0.1 --- src/NuGet/ColonesExchangeRate/ColonesExchangeRate.csproj | 4 ++-- src/npm/colonesexchangerate.mjs | 8 ++++---- src/npm/package.json | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/NuGet/ColonesExchangeRate/ColonesExchangeRate.csproj b/src/NuGet/ColonesExchangeRate/ColonesExchangeRate.csproj index 0990fdc..cc802c8 100644 --- a/src/NuGet/ColonesExchangeRate/ColonesExchangeRate.csproj +++ b/src/NuGet/ColonesExchangeRate/ColonesExchangeRate.csproj @@ -12,8 +12,8 @@ colones; dollars; euros; currency-exchange; exchange-rate; costa-rica; CRC; LICENSE https://github.com/dsanchezcr/ColonesExchangeRate - 2.0.0 - 2.0.0 + 2.0.1 + 2.0.1 Currency conversion from Colones (Costa Rica - CRC ₡) to Dollars (United States - USD $) and Euros (European Union - EUR €). It consumes the exchange rate API from Ministerio de Hacienda de Costa Rica. diff --git a/src/npm/colonesexchangerate.mjs b/src/npm/colonesexchangerate.mjs index 282d06a..98e4b05 100644 --- a/src/npm/colonesexchangerate.mjs +++ b/src/npm/colonesexchangerate.mjs @@ -41,8 +41,8 @@ class ColonesExchangeRate { // Method to convert Colones to Euros colonesToEuros(amount) { return this.convertCurrency(amount, rate => { - if (rate?.Euro?.Colones != null) - return 1 / rate.Euro.Colones; + if (rate?.euro?.colones != null) + return 1 / rate.euro.colones; else return 1 / ((rate?.dolar?.compra?.valor ?? 0) * parseFloat(rate?.euro?.valor ?? "0")); }); @@ -51,8 +51,8 @@ class ColonesExchangeRate { // Method to convert Euros to Colones eurosToColones(amount) { return this.convertCurrency(amount, rate => { - if (rate?.Euro?.Colones != null) - return rate.Euro.Colones; + if (rate?.euro?.colones != null) + return rate.euro.colones; else { return (parseFloat(rate?.euro?.valor ?? "0") * (rate?.dolar?.venta?.valor ?? 0)); } diff --git a/src/npm/package.json b/src/npm/package.json index 54c9305..7bc221f 100644 --- a/src/npm/package.json +++ b/src/npm/package.json @@ -1,6 +1,6 @@ { "name": "@dsanchezcr/colonesexchangerate", - "version": "2.0.0", + "version": "2.0.1", "type": "module", "description": "Currency conversion from Colones (Costa Rica - CRC ₡) to Dollars (United States - USD $) and Euros (European Union - EUR €). It consumes the exchange rate API from Ministerio de Hacienda de Costa Rica.", "main": "ColonesExchangeRate.mjs",