Skip to content

Commit

Permalink
fix lint (DavideViolante#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
liardoecp committed Oct 22, 2024
1 parent b8f83a7 commit 7749be3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ const mapResponse = (array = []) => array.map((item) => ({
}));

module.exports = {
mapResponse
mapResponse,
};
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,20 @@ function checkParams(input, period, interval, pointscount) {
* @return {Promise<Array>} 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) {
throw new Error(`Response status: ${response.status}`);
}

const json = await response.json();
return json.data
return json.data;
}

/**
Expand Down
2 changes: 0 additions & 2 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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);
});

});

0 comments on commit 7749be3

Please sign in to comment.