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.0 to 0.3.1

2

package.json
{
"name": "xfetch-js",
"version": "0.3.0",
"version": "0.3.1",
"description": "",

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

@@ -92,3 +92,3 @@ /*

}
const isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined'
const isBrowser = typeof self !== 'undefined' // works in both window & worker scope
return isBrowser

@@ -95,0 +95,0 @@ ? 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)=>b=>a.some(a=>"string"==typeof a?typeof b==a:b instanceof a),g=f("string"),h=f("object"),i=a=>g(a)||h(a),j=a=>{if(!a.ok)throw new b(a);return a},k=(h={})=>{const l=(a,b={})=>{d(b,h);const k=a=>new b.URLSearchParams(a).toString(),l=new b.URL(a,b.baseURI||void 0);if(b.headers?f(b.Headers)(b.headers)&&(b.headers=e([...b.headers.entries()])):b.headers={},b.json)b.body=JSON.stringify(b.json),b.headers["Content-Type"]="application/json";else if(i(b.urlencoded))b.body=g(b.urlencoded)?b.urlencoded:k(b.urlencoded),b.headers["Content-Type"]="application/x-www-form-urlencoded";else if(f(b.FormData,"object")(b.formData)){if(!f(b.FormData)(b.formData)){const a=new b.FormData;for(const[c,d]of Object.entries(b.formData))a.append(c,d);b.formData=a}b.body=b.formData}return b.qs&&(g(b.qs)&&(b.qs=(a=>e([...new b.URLSearchParams(a).entries()]))(b.qs)),l.search=k(d(e([...l.searchParams.entries()]),b.qs))),b.credentials||(b.credentials="same-origin"),c.resolve(b.fetch(l,b).then(j))};for(const b of a)l[b]=(a,c={})=>(c.method=b.toUpperCase(),l(a,c));return l.extend=a=>k(d({},h,a)),l.HTTPError=b,l},l="undefined"!=typeof window&&"undefined"!=typeof document;return l?k({fetch:fetch.bind(window),URL,Response,URLSearchParams,Headers,FormData,baseURI:document.baseURI}):k()});
((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)=>b=>a.some(a=>"string"==typeof a?typeof b==a:b instanceof a),g=f("string"),h=f("object"),i=a=>g(a)||h(a),j=a=>{if(!a.ok)throw new b(a);return a},k=(h={})=>{const l=(a,b={})=>{d(b,h);const k=a=>new b.URLSearchParams(a).toString(),l=new b.URL(a,b.baseURI||void 0);if(b.headers?f(b.Headers)(b.headers)&&(b.headers=e([...b.headers.entries()])):b.headers={},b.json)b.body=JSON.stringify(b.json),b.headers["Content-Type"]="application/json";else if(i(b.urlencoded))b.body=g(b.urlencoded)?b.urlencoded:k(b.urlencoded),b.headers["Content-Type"]="application/x-www-form-urlencoded";else if(f(b.FormData,"object")(b.formData)){if(!f(b.FormData)(b.formData)){const a=new b.FormData;for(const[c,d]of Object.entries(b.formData))a.append(c,d);b.formData=a}b.body=b.formData}return b.qs&&(g(b.qs)&&(b.qs=(a=>e([...new b.URLSearchParams(a).entries()]))(b.qs)),l.search=k(d(e([...l.searchParams.entries()]),b.qs))),b.credentials||(b.credentials="same-origin"),c.resolve(b.fetch(l,b).then(j))};for(const b of a)l[b]=(a,c={})=>(c.method=b.toUpperCase(),l(a,c));return l.extend=a=>k(d({},h,a)),l.HTTPError=b,l},l="undefined"!=typeof self;return l?k({fetch:fetch.bind(window),URL,Response,URLSearchParams,Headers,FormData,baseURI:document.baseURI}):k()});
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