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.2.1 to 0.2.2

2

package.json
{
"name": "xfetch-js",
"version": "0.2.1",
"version": "0.2.2",
"description": "",

@@ -5,0 +5,0 @@ "main": "node.js",

@@ -79,4 +79,4 @@ /*

return isBrowser
? extend({ fetch: fetch.bind(window), URL, Response, URLSearchParams, baseURI: document.baseURI })
? extend({ fetch: fetch.bind(window), URL, Response, URLSearchParams, Headers, baseURI: document.baseURI })
: extend()
})

@@ -1,1 +0,1 @@

((a,b)=>{"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?module.exports=b():a.xf=b()})(this,()=>{const a=["get","post","put","patch","delete","head"];class b extends Error{constructor(a){super(a.statusText),this.name="HTTPError",this.response=a}}class c extends Promise{}for(const a of["arrayBuffer","blob","formData","json","text"])c.prototype[a]=function(b){return this.then(b=>b[a]()).then(b||(a=>a))};const{assign:d}=Object,e=a=>a.reduce((a,[b,c])=>(a[b]=c,a),{}),f=a=>{if(!a.ok)throw new b(a);return a},g=(h={})=>{const i=(a,b={})=>{d(b,h);const g=a=>new b.URLSearchParams(a).toString(),i=new b.URL(a,b.baseURI||void 0);return b.headers?b.headers instanceof b.Headers&&(b.headers=e([...b.headers.entries()])):b.headers={},b.json?(b.body=JSON.stringify(b.json),b.headers["Content-Type"]="application/json"):b.form&&(b.body=g(b.form),b.headers["Content-Type"]="application/x-www-form-urlencoded"),b.qs&&("string"==typeof b.qs&&(b.qs=(a=>e([...new b.URLSearchParams(a).entries()]))(b.qs)),i.search=g(d(e([...i.searchParams.entries()]),b.qs))),b.credentials||(b.credentials="same-origin"),c.resolve(b.fetch(i,b).then(f))};for(const b of a)i[b]=(a,c={})=>(c.method=b,i(a,c));return i.extend=a=>g(d({},h,a)),i.HTTPError=b,i},h="undefined"!=typeof window&&"undefined"!=typeof document;return h?g({fetch:fetch.bind(window),URL,Response,URLSearchParams,baseURI:document.baseURI}):g()});
((a,b)=>{"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?module.exports=b():a.xf=b()})(this,()=>{const a=["get","post","put","patch","delete","head"];class b extends Error{constructor(a){super(a.statusText),this.name="HTTPError",this.response=a}}class c extends Promise{}for(const a of["arrayBuffer","blob","formData","json","text"])c.prototype[a]=function(b){return this.then(b=>b[a]()).then(b||(a=>a))};const{assign:d}=Object,e=a=>a.reduce((a,[b,c])=>(a[b]=c,a),{}),f=a=>{if(!a.ok)throw new b(a);return a},g=(h={})=>{const i=(a,b={})=>{d(b,h);const g=a=>new b.URLSearchParams(a).toString(),i=new b.URL(a,b.baseURI||void 0);return b.headers?b.headers instanceof b.Headers&&(b.headers=e([...b.headers.entries()])):b.headers={},b.json?(b.body=JSON.stringify(b.json),b.headers["Content-Type"]="application/json"):b.form&&(b.body=g(b.form),b.headers["Content-Type"]="application/x-www-form-urlencoded"),b.qs&&("string"==typeof b.qs&&(b.qs=(a=>e([...new b.URLSearchParams(a).entries()]))(b.qs)),i.search=g(d(e([...i.searchParams.entries()]),b.qs))),b.credentials||(b.credentials="same-origin"),c.resolve(b.fetch(i,b).then(f))};for(const b of a)i[b]=(a,c={})=>(c.method=b,i(a,c));return i.extend=a=>g(d({},h,a)),i.HTTPError=b,i},h="undefined"!=typeof window&&"undefined"!=typeof document;return h?g({fetch:fetch.bind(window),URL,Response,URLSearchParams,Headers,baseURI:document.baseURI}):g()});
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