diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..3bb9642 --- /dev/null +++ b/.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 }}" diff --git a/README.md b/README.md index 6255592..8a9d040 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/packages/isomorphic-unfetch/index.js b/packages/isomorphic-unfetch/index.js index 6ae374c..98eac4e 100644 --- a/packages/isomorphic-unfetch/index.js +++ b/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); }) ); diff --git a/packages/isomorphic-unfetch/package.json b/packages/isomorphic-unfetch/package.json index 0d544d0..216de43 100644 --- a/packages/isomorphic-unfetch/package.json +++ b/packages/isomorphic-unfetch/package.json @@ -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"