Skip to content

Commit

Permalink
Replace axios with a native fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
darekkay committed Nov 5, 2024
1 parent 8bcdea4 commit 74a3fcb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 21 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## [Unreleased]

- :hammer: Replace axios with a native fetch.

## [4.1.0] - 2024-05-15

- :bug: Fix issue with missing Playwright browsers.
Expand Down
25 changes: 8 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"@playwright/browser-firefox": "1.44.0",
"@playwright/browser-webkit": "1.44.0",
"axe-core": "^4.9.1",
"axios": "1.6.8",
"dayjs": "1.11.11",
"fast-xml-parser": "4.3.6",
"fs-extra": "11.2.0",
Expand Down
4 changes: 1 addition & 3 deletions src/utils/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const _ = require("lodash");
const axios = require("axios");
const { XMLParser } = require("fast-xml-parser");
const { readFileSync } = require("fs-extra");
const json5 = require("json5");
Expand All @@ -17,8 +16,7 @@ const configArrayCustomizer = (objectValue, sourceValue) => {

const getUrlsForSitemap = async (sitemapUrl) => {
try {
const response = await axios.get(sitemapUrl);
const sitemap = response.data;
const sitemap = await fetch(sitemapUrl).then((res) => res.text());
if (sitemap) {
const xml = new XMLParser({ ignoreAttributes: false });
const json = xml.parse(sitemap);
Expand Down

0 comments on commit 74a3fcb

Please sign in to comment.