Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jan 20, 2025
1 parent d3cb870 commit 39ec744
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ You can simply import `{ fetch }` from `node-fetch-native/proxy` with a preconfi
```ts
import { fetch } from "node-fetch-native/proxy";

console.log(await fetch("https://icanhazip.com").then((r) => r.text());
console.log(await fetch("https://icanhazip.com").then((r) => r.text()));
```

### `createFetch` utility
Expand All @@ -140,7 +140,7 @@ import { createFetch } from "node-fetch-native/proxy";

const fetch = createFetch({ url: "http://localhost:9080" });

console.log(await fetch("https://icanhazip.com").then((r) => r.text());
console.log(await fetch("https://icanhazip.com").then((r) => r.text()));
```

### `createProxy` utility
Expand All @@ -154,7 +154,9 @@ import { createProxy } from "node-fetch-native/proxy";
const proxy = createProxy();
// const proxy = createProxy({ url: "http://localhost:8080" });

console.log(await fetch("https://icanhazip.com", { ...proxy }).then((r) => r.text());
console.log(
await fetch("https://icanhazip.com", { ...proxy }).then((r) => r.text()),
);
```

## Alias to `node-fetch`
Expand All @@ -169,8 +171,8 @@ Using npm [overrides](https://docs.npmjs.com/cli/v8/configuring-npm/package-json
// package.json
{
"overrides": {
"node-fetch": "npm:node-fetch-native@latest"
}
"node-fetch": "npm:node-fetch-native@latest",
},
}
```

Expand All @@ -182,8 +184,8 @@ Using yarn [selective dependency resolutions](https://classic.yarnpkg.com/lang/e
// package.json
{
"resolutions": {
"node-fetch": "npm:node-fetch-native@latest"
}
"node-fetch": "npm:node-fetch-native@latest",
},
}
```

Expand All @@ -196,9 +198,9 @@ Using [pnpm.overrides](https://pnpm.io/package_json#pnpmoverrides):
{
"pnpm": {
"overrides": {
"node-fetch": "npm:node-fetch-native@latest"
}
}
"node-fetch": "npm:node-fetch-native@latest",
},
},
}
```

Expand Down
4 changes: 3 additions & 1 deletion src/polyfill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ function polyfill(name: string, impl: any) {
if (!(name in globalThis)) {
try {
globalThis[name] = impl;
} catch {}
} catch {
// Ignore
}
}
}

Expand Down

0 comments on commit 39ec744

Please sign in to comment.