Skip to content

Commit

Permalink
fix lint (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
liardoecp committed Oct 21, 2024
1 parent c5a15d5 commit cd80a1c
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 @@ -15,5 +15,5 @@ function mapResponse(array = []) {
}

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);
assert.strictEqual(mockData[0][0], mappedResponse[0].date);
Expand Down Expand Up @@ -45,5 +44,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 cd80a1c

Please sign in to comment.