From 7749be376f946cdae9df3448d4b489ebda2f2ff0 Mon Sep 17 00:00:00 2001 From: Emanuele Liardo Date: Mon, 21 Oct 2024 19:44:48 +0200 Subject: [PATCH] fix lint (#121) --- functions.js | 2 +- index.js | 8 ++++---- test/test.js | 2 -- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/functions.js b/functions.js index 9664d5f..e050403 100644 --- a/functions.js +++ b/functions.js @@ -14,5 +14,5 @@ const mapResponse = (array = []) => array.map((item) => ({ })); module.exports = { - mapResponse + mapResponse, }; diff --git a/index.js b/index.js index e5ff813..f4fe45d 100644 --- a/index.js +++ b/index.js @@ -38,12 +38,12 @@ function checkParams(input, period, interval, pointscount) { * @return {Promise} An array of arrays with date (timestamp) and values (number) properties */ async function callInvesting(pairId, period, interval, pointscount) { - const url = `https://api.investing.com/api/financialdata/${pairId}/historical/chart?period=${period}&interval=${interval}&pointscount=${pointscount}` + const url = `https://api.investing.com/api/financialdata/${pairId}/historical/chart?period=${period}&interval=${interval}&pointscount=${pointscount}`; const response = await fetch(url, { headers: new Headers({ - "upgrade-insecure-requests": "1" - }) + 'upgrade-insecure-requests': '1', + }), }); if (!response.ok) { @@ -51,7 +51,7 @@ async function callInvesting(pairId, period, interval, pointscount) { } const json = await response.json(); - return json.data + return json.data; } /** diff --git a/test/test.js b/test/test.js index acf541c..eac55ce 100644 --- a/test/test.js +++ b/test/test.js @@ -11,7 +11,6 @@ const mockData = [ ]; describe('Tests for Investing.com unofficial APIs', () => { - it('should map an array of arrays to array of objects', () => { const mappedResponse = mapResponse(mockData); const expected = [ @@ -80,5 +79,4 @@ describe('Tests for Investing.com unofficial APIs', () => { const response = await investing('currencies/eur-usd', 'P1M', 'P1D', 20); assert.strictEqual(response, undefined); }); - });