Comparing version 0.5.0 to 0.6.0
{ | ||
"name": "fitch", | ||
"version": "0.5.0", | ||
"description": "Test using fetch API", | ||
"main": "src/index.js", | ||
"scripts": { | ||
"start": "node ./api/index.js", | ||
"lint": "eslint src", | ||
"test": "ava ./tests/*", | ||
"watch:test": "npm test -- -w", | ||
"coverage": "nyc ava ./tests/*", | ||
"examples": "node ./examples/index.js" | ||
}, | ||
"version": "0.6.0", | ||
"description": "A lightweight Promise based HTTP client, using Fetch API.", | ||
"keywords": [ | ||
"fetch", | ||
"fitch" | ||
], | ||
"license": "MIT", | ||
"repository": { | ||
@@ -18,4 +14,2 @@ "type": "git", | ||
}, | ||
"author": "", | ||
"license": "MIT", | ||
"bugs": { | ||
@@ -25,2 +19,3 @@ "url": "https://github.com/raphaelpor/fitch.js/issues" | ||
"homepage": "https://github.com/raphaelpor/fitch.js#readme", | ||
"main": "src/index.js", | ||
"dependencies": { | ||
@@ -32,10 +27,18 @@ "es6-promise": "^4.0.5", | ||
"ava": "^0.16.0", | ||
"eslint": "^3.8.1", | ||
"eslint-config-airbnb": "^12.0.0", | ||
"eslint-plugin-import": "^2.0.1", | ||
"eslint": "^3.9.1", | ||
"eslint-config-airbnb": "^13.0.0", | ||
"eslint-plugin-import": "^2.2.0", | ||
"eslint-plugin-jsx-a11y": "^2.2.3", | ||
"eslint-plugin-react": "^6.4.1", | ||
"eslint-plugin-react": "^6.6.0", | ||
"hapi": "^15.2.0", | ||
"nyc": "^8.3.2" | ||
"nyc": "^8.4.0" | ||
}, | ||
"scripts": { | ||
"start": "node ./api/index.js", | ||
"lint": "eslint src", | ||
"test": "ava ./tests/*", | ||
"watch:test": "npm test -- -w", | ||
"coverage": "nyc ava ./tests/*", | ||
"examples": "node ./examples/index.js" | ||
} | ||
} |
@@ -5,9 +5,15 @@  | ||
[](https://badge.fury.io/js/fitch) | ||
[](https://travis-ci.org/raphaelpor/fitch.js) | ||
[](https://github.com/raphaelpor/fitch.js/blob/master/docs/Intro.md) | ||
[](https://github.com/raphaelpor/fitch.js/blob/master/LICENSE.md) | ||
* [Documentation](https://github.com/raphaelpor/fitch.js/blob/master/docs/Intro.md) | ||
* [License](https://github.com/raphaelpor/fitch.js/blob/master/LICENSE.md) | ||
[](https://www.bithound.io/github/raphaelpor/fitch.js) | ||
[](https://www.bithound.io/github/raphaelpor/fitch.js/master/dependencies/npm) | ||
[](https://www.bithound.io/github/raphaelpor/fitch.js) | ||
## Get started | ||
[Read the full Documentation](https://github.com/raphaelpor/fitch.js/blob/master/docs/Intro.md) | ||
### Install | ||
@@ -14,0 +20,0 @@ ```sh |
module.exports = { | ||
create( | ||
method, | ||
{ | ||
body, | ||
cache = 'default', | ||
credentials, | ||
headers = { 'Content-Type': 'application/json' }, | ||
mode = 'cors', | ||
redirect, | ||
} = {} | ||
) { | ||
create(method, { | ||
body, | ||
cache = 'default', | ||
credentials, | ||
headers = { 'Content-Type': 'application/json' }, | ||
integrity, | ||
mode = 'cors', | ||
redirect, | ||
referrer, | ||
referrerPolicy, | ||
} = {}) { | ||
let data; | ||
if (body) { | ||
data = JSON.stringify(body); | ||
} | ||
return { | ||
method, | ||
const result = { | ||
body: data, | ||
@@ -25,4 +26,15 @@ cache, | ||
redirect, | ||
referrer, | ||
}; | ||
if (integrity) { | ||
result.integrity = integrity; | ||
} | ||
if (referrerPolicy) { | ||
result.referrerPolicy = referrerPolicy; | ||
} | ||
return result; | ||
}, | ||
}; |
Sorry, the diff of this file is not supported yet
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
23308
14
86
125