Skip to content

Commit

Permalink
Merge branch 'master' into refactor-and-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
developit committed Feb 18, 2020
2 parents 120da94 + c5bdee7 commit 1477655
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/main.yml
@@ -0,0 +1,16 @@
name: Compressed Size

on: [pull_request]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2-beta
with:
fetch-depth: 1
- uses: preactjs/compressed-size-action@v1
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -139,7 +139,7 @@ Unfetch will account for the following properties in `options`:
target resource (The most common ones being `GET`, `POST`, `PUT`, `PATCH`, `HEAD`, `OPTIONS` or `DELETE`).
* `headers`: An `Object` containing additional information to be sent with the request, e.g. `{ 'Content-Type': 'application/json' }` to indicate a JSON-typed request body.
* `credentials`: ⚠ Accepts a `"include"` string, which will allow both CORS and same origin requests to work with cookies. As pointed in the ['Caveats' section](#caveats), Unfetch won't send or receive cookies otherwise. The `"same-origin"` value is not supported. ⚠
* `body`: The content to be transmited in request's body. Common content types include `FormData`, `JSON`, `Blob`, `ArrayBuffer` or plain text.
* `body`: The content to be transmitted in request's body. Common content types include `FormData`, `JSON`, `Blob`, `ArrayBuffer` or plain text.

### `response` Methods and Attributes
These methods are used to handle the response accordingly in your Promise chain. Instead of implementing full spec-compliant [Response Class](https://fetch.spec.whatwg.org/#response-class) functionality, Unfetch provides the following methods and attributes:
Expand Down
2 changes: 1 addition & 1 deletion packages/isomorphic-unfetch/index.js
@@ -1,5 +1,5 @@
module.exports = global.fetch = global.fetch || (
typeof process=='undefined' ? (require('unfetch').default || require('unfetch')) : (function(url, opts) {
return require('node-fetch')(url.replace(/^\/\//g,'https://'), opts);
return (require('node-fetch').default || require('node-fetch'))(url.replace(/^\/\//g,'https://'), opts);
})
);
2 changes: 2 additions & 0 deletions packages/isomorphic-unfetch/package.json
Expand Up @@ -7,10 +7,12 @@
"index.d.ts",
"browser.js"
],
"license": "MIT",
"repository": "developit/unfetch",
"browser": "browser.js",
"main": "index.js",
"types": "index.d.ts",
"license": "MIT",
"dependencies": {
"node-fetch": "^2.2.0",
"unfetch": "^4.0.0"
Expand Down

0 comments on commit 1477655

Please sign in to comment.