web-std / io

Web standard IO APIs implemented for nodejs
92 stars 31 forks source link

fix(fetch): add HTTPS Agent types to `fetch` & `Request` #78

Closed MichaelDeBoey closed 1 year ago

MichaelDeBoey commented 1 year ago

See @cliffordfajardo's https://github.com/remix-run/web-std-io/pull/18

What is the change?

  • Add typings for https agent
  • Add correct typings fetch's options param

Why are we making this change?

Tests

Type changes only. Ran npm test inside of package/fetch and all tests pass

Test output for `package/fetch` ``` 247 passing (4s) 4 pending -----------------|---------|----------|---------|---------|----------------------------------------- File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s -----------------|---------|----------|---------|---------|----------------------------------------- All files | 97.15 | 96.79 | 89.32 | 97.15 | src | 96.69 | 96.58 | 86.58 | 96.69 | body.js | 96.97 | 95.45 | 97.36 | 96.97 | 211-212,250-254,263,464-473 fetch.js | 99.46 | 96.38 | 100 | 99.46 | 117-118 headers.js | 92.73 | 93.75 | 81.81 | 92.73 | 16-24,29-38,95-96 lib.node.js | 100 | 100 | 100 | 100 | package.js | 100 | 100 | 100 | 100 | request.js | 95.62 | 100 | 56.25 | 95.62 | ...-170,173-174,178-179,183-184,188-189 response.js | 98.59 | 100 | 90.9 | 98.59 | 59-60 src/errors | 100 | 100 | 100 | 100 | abort-error.js | 100 | 100 | 100 | 100 | base.js | 100 | 100 | 100 | 100 | fetch-error.js | 100 | 100 | 100 | 100 | src/utils | 99.27 | 97.4 | 100 | 99.27 | form-data.js | 98.29 | 92 | 100 | 98.29 | 115-116 get-search.js | 100 | 100 | 100 | 100 | is-redirect.js | 100 | 100 | 100 | 100 | is.js | 100 | 100 | 100 | 100 | utf8.js | 100 | 100 | 100 | 100 | -----------------|---------|----------|---------|---------|----------------------------------------- ```

CC/ @alanshaw @Gozala