Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

xfetch-js

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xfetch-js - npm Package Compare versions

Comparing version 0.3.4 to 0.4.0

dist/xfetch.min.js

14

package.json
{
"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(''))

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc