Skip to content

Commit

Permalink
chore: remove node-fetch usage (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsanders11 authored Sep 11, 2024
1 parent 1610d62 commit 330a6b0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"version": "1.0.0",
"main": "src/index.js",
"license": "MIT",
"engines": {
"node": ">=20"
},
"dependencies": {
"@electron/github-app-auth": "^1.2.0",
"@octokit/rest": "^18.3.5",
Expand All @@ -15,7 +18,6 @@
"express-paginate": "^1.0.2",
"jsdom": "^23.0.1",
"markdown-it": "^12.1.0",
"node-fetch": "^2.6.1",
"p-memoize": "^4.0.1",
"prismjs": "^1.29.0",
"semver": "^7.5.2",
Expand Down
9 changes: 3 additions & 6 deletions src/data.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const { getAuthOptionsForRepo, appCredentialsFromString } = require('@electron/github-app-auth');
const fetch = require('node-fetch');
const { Octokit } = require('@octokit/rest');
const ExpiryMap = require('expiry-map');
const pMemoize = require('p-memoize');
Expand Down Expand Up @@ -34,7 +33,7 @@ const getOctokit = async () => {

const getReleasesOrUpdate = pMemoize(
async () => {
const response = await fetch.default('https://electronjs.org/headers/index.json');
const response = await fetch('https://electronjs.org/headers/index.json');
const releases = await response.json();
return releases.sort((a, b) => semver.compare(b.version, a.version));
},
Expand All @@ -46,7 +45,7 @@ const getReleasesOrUpdate = pMemoize(

const getActiveReleasesOrUpdate = pMemoize(
async () => {
const response = await fetch.default('https://electron-sudowoodo.herokuapp.com/release/active');
const response = await fetch('https://electron-sudowoodo.herokuapp.com/release/active');
return response.json();
},
{
Expand All @@ -57,9 +56,7 @@ const getActiveReleasesOrUpdate = pMemoize(

const getAllSudowoodoReleasesOrUpdate = pMemoize(
async () => {
const response = await fetch.default(
'https://electron-sudowoodo.herokuapp.com/release/history',
);
const response = await fetch('https://electron-sudowoodo.herokuapp.com/release/history');
return response.json();
},
{
Expand Down

0 comments on commit 330a6b0

Please sign in to comment.