Comparing version 0.3.4 to 0.4.0
{ | ||
"name": "xfetch-js", | ||
"version": "0.3.4", | ||
"version": "0.4.0", | ||
"description": "", | ||
"main": "node.js", | ||
"browser": "xfetch.min.js", | ||
"main": "src/node.js", | ||
"browser": "dist/xfetch.min.js", | ||
"scripts": { | ||
"test": "npm run test:js && npm run test:typing", | ||
"test:js": "ava", | ||
"test:typing": "tsc --strict --outDir .trash test/typing.ts", | ||
"min": "minify xfetch.js -o xfetch.min.js", | ||
"prepare": "npm run test && npm run min" | ||
"test": "ava && tsc --strict --outDir .trash test/typing.ts", | ||
"min": "minify src/xfetch.js -o dist/xfetch.min.js", | ||
"prepare": "yarn test && yarn min" | ||
}, | ||
@@ -14,0 +12,0 @@ "dependencies": { |
import test from 'ava' | ||
import { Headers } from 'node-fetch' | ||
import xf from '../node' | ||
import xf from '../src/node' | ||
import FormData from 'form-data' | ||
@@ -89,1 +89,18 @@ | ||
}) | ||
test('support deep object merging', async t => { | ||
const client2 = client.extend({ | ||
headers: { | ||
Authorization: 'Bearer asdfghjkl' | ||
}, | ||
qs: { | ||
apiVersion: 2 | ||
} | ||
}) | ||
const r = await client2.get('/get', { headers: { 'Content-Type': 'application/json' }, qs: { q: 'test' } }).json() | ||
t.is(r.headers['authorization'], 'Bearer asdfghjkl') | ||
t.is(r.headers['content-type'], 'application/json') | ||
t.deepEqual(r.args, { | ||
apiVersion: '2', | ||
q: 'test' | ||
}) | ||
}) |
declare const expect: <T>(value: T) => void // type assertion helper | ||
import xf = require('../xfetch') | ||
import { XFetch, XPromise, HTTPError } from '../xfetch.base' | ||
import xf = require('../src/xfetch') | ||
import { XFetch, XPromise, HTTPError } from '../src/xfetch.base' | ||
@@ -5,0 +5,0 @@ expect<XPromise<Response>>(xf.get('')) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17585
303
5