Socket
Socket
Sign inDemoInstall

redaxios

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redaxios - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

dist/index.d.ts

2

dist/redaxios.js

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

var e=function e(t){function r(e){return function(t,r){return a(t,Object.assign({method:e},r))}}function o(e){return function(t,r,o){return a(t,Object.assign({method:e,data:r},o))}}function n(e,t,r){if(Array.isArray(e))return e.concat(t);if(t&&"object"==typeof t){var o,a={};if(e)for(o in e)a[r?o.toLowerCase():o]=e[o];for(o in t){var i=r?o.toLowerCase():o;"headers"===i&&(r=!0),a[i]=o in a?n(a[i],t[o],r):t[o]}return a}return t}function a(e,r){"string"!=typeof e&&(e=(r=e).url);var o=n(t,r||{}),a=o.data;if(o.transformRequest)for(var i=0;i<o.transformRequest.length;i++){var s=o.transformRequest[i](a,o.headers);void 0!==s&&(a=s)}var u={};if(a&&"object"==typeof a&&(a=JSON.stringify(a),u["Content-Type"]="application/json"),o.xsrfCookieName)for(var f=document.cookie.split(/ *[;=] */),c=0;c<f.length;c+=2)if(f[c]==o.xsrfCookieName){u[o.xsrfHeaderName]=decodeURIComponent(f[c+1]);break}o.auth&&(u.Authorization=o.auth);var p={};return p.config=r,fetch(e,{method:o.method,body:a,headers:n(o.headers,u,!0)}).then(function(e){var t;for(t in e)"function"!=typeof e[t]&&(p[t]=e[t]);return(o.validateStatus?o.validateStatus(e.status):e.ok)?("stream"===o.responseType?Promise.resolve(e.body):e[o.responseType||"text"]()).then(function(e){return p.data=e,p}):Promise.reject(e)})}return t=t||{},a.request=a,a.get=r("get"),a.delete=r("delete"),a.options=r("options"),a.post=o("post"),a.put=o("put"),a.patch=o("patch"),a.all=Promise.all,a.spread=function(e){return function(t){return e.apply(this,t)}},a.CancelToken=self.AbortController||Object,a.create=e,a}();module.exports=e;
var t=function t(e){function r(t,e,n){var a,o={};if(Array.isArray(t))return t.concat(e);for(a in t)o[n?a.toLowerCase():a]=t[a];for(a in e){var i=n?a.toLowerCase():a,u=e[a];o[i]=i in o&&"object"==typeof u?r(o[i],u,"headers"===i):u}return o}function n(t,n,a,o){"string"!=typeof t&&(t=(n=t).url);var i={config:n},u=r(e,n),s={},c=o||u.data;(u.transformRequest||[]).map(function(t){c=t(c,u.headers)||c}),c&&"object"==typeof c&&"function"!=typeof c.append&&(c=JSON.stringify(c),s["content-type"]="application/json");var f=document.cookie.match(RegExp("(^|; )"+u.xsrfCookieName+"=([^;]*)"));if(f&&(s[u.xsrfHeaderName]=f[2]),u.auth&&(s.authorization=u.auth),u.baseURL&&(t=new URL(t,u.baseURL)+""),u.params){var p=~t.indexOf("?")?"&":"?";t+=p+(u.paramsSerializer?u.paramsSerializer(u.params):new URLSearchParams(u.params))}return(u.fetch||fetch)(t,{method:a||u.method,body:c,headers:r(u.headers,s,!0),credentials:u.withCredentials?"include":void 0}).then(function(t){for(var e in t)"function"!=typeof t[e]&&(i[e]=t[e]);return(u.validateStatus?u.validateStatus(t.status):t.ok)?"stream"==u.responseType?(i.data=t.body,i):t[u.responseType||"text"]().then(function(t){i.data=t,i.data=JSON.parse(t)}).catch(Object).then(function(){return i}):Promise.reject(i)})}return e=e||{},n.request=n,n.get=function(t,e){return n(t,e,"get")},n.delete=function(t,e){return n(t,e,"delete")},n.options=function(t,e){return n(t,e,"options")},n.post=function(t,e,r){return n(t,r,"post",e)},n.put=function(t,e,r){return n(t,r,"put",e)},n.patch=function(t,e,r){return n(t,r,"patch",e)},n.all=Promise.all,n.spread=function(t){return function(e){return t.apply(this,e)}},n.CancelToken="function"==typeof AbortController?AbortController:Object,n.defaults=e,n.create=t,n}();module.exports=t;
//# sourceMappingURL=redaxios.js.map

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

export default(function e(t){function r(e){return function(t,r){return a(t,Object.assign({method:e},r))}}function o(e){return function(t,r,o){return a(t,Object.assign({method:e,data:r},o))}}function n(e,t,r){if(Array.isArray(e))return e.concat(t);if(t&&"object"==typeof t){var o,a={};if(e)for(o in e)a[r?o.toLowerCase():o]=e[o];for(o in t){var i=r?o.toLowerCase():o;"headers"===i&&(r=!0),a[i]=o in a?n(a[i],t[o],r):t[o]}return a}return t}function a(e,r){"string"!=typeof e&&(e=(r=e).url);var o=n(t,r||{}),a=o.data;if(o.transformRequest)for(var i=0;i<o.transformRequest.length;i++){var s=o.transformRequest[i](a,o.headers);void 0!==s&&(a=s)}var u={};if(a&&"object"==typeof a&&(a=JSON.stringify(a),u["Content-Type"]="application/json"),o.xsrfCookieName)for(var f=document.cookie.split(/ *[;=] */),c=0;c<f.length;c+=2)if(f[c]==o.xsrfCookieName){u[o.xsrfHeaderName]=decodeURIComponent(f[c+1]);break}o.auth&&(u.Authorization=o.auth);var p={};return p.config=r,fetch(e,{method:o.method,body:a,headers:n(o.headers,u,!0)}).then(function(e){var t;for(t in e)"function"!=typeof e[t]&&(p[t]=e[t]);return(o.validateStatus?o.validateStatus(e.status):e.ok)?("stream"===o.responseType?Promise.resolve(e.body):e[o.responseType||"text"]()).then(function(e){return p.data=e,p}):Promise.reject(e)})}return t=t||{},a.request=a,a.get=r("get"),a.delete=r("delete"),a.options=r("options"),a.post=o("post"),a.put=o("put"),a.patch=o("patch"),a.all=Promise.all,a.spread=function(e){return function(t){return e.apply(this,t)}},a.CancelToken=self.AbortController||Object,a.create=e,a}());
export default(function t(e){function r(t,e,n){var a,o={};if(Array.isArray(t))return t.concat(e);for(a in t)o[n?a.toLowerCase():a]=t[a];for(a in e){var i=n?a.toLowerCase():a,u=e[a];o[i]=i in o&&"object"==typeof u?r(o[i],u,"headers"===i):u}return o}function n(t,n,a,o){"string"!=typeof t&&(t=(n=t).url);var i={config:n},u=r(e,n),s={},c=o||u.data;(u.transformRequest||[]).map(function(t){c=t(c,u.headers)||c}),c&&"object"==typeof c&&"function"!=typeof c.append&&(c=JSON.stringify(c),s["content-type"]="application/json");var f=document.cookie.match(RegExp("(^|; )"+u.xsrfCookieName+"=([^;]*)"));if(f&&(s[u.xsrfHeaderName]=f[2]),u.auth&&(s.authorization=u.auth),u.baseURL&&(t=new URL(t,u.baseURL)+""),u.params){var p=~t.indexOf("?")?"&":"?";t+=p+(u.paramsSerializer?u.paramsSerializer(u.params):new URLSearchParams(u.params))}return(u.fetch||fetch)(t,{method:a||u.method,body:c,headers:r(u.headers,s,!0),credentials:u.withCredentials?"include":void 0}).then(function(t){for(var e in t)"function"!=typeof t[e]&&(i[e]=t[e]);return(u.validateStatus?u.validateStatus(t.status):t.ok)?"stream"==u.responseType?(i.data=t.body,i):t[u.responseType||"text"]().then(function(t){i.data=t,i.data=JSON.parse(t)}).catch(Object).then(function(){return i}):Promise.reject(i)})}return e=e||{},n.request=n,n.get=function(t,e){return n(t,e,"get")},n.delete=function(t,e){return n(t,e,"delete")},n.options=function(t,e){return n(t,e,"options")},n.post=function(t,e,r){return n(t,r,"post",e)},n.put=function(t,e,r){return n(t,r,"put",e)},n.patch=function(t,e,r){return n(t,r,"patch",e)},n.all=Promise.all,n.spread=function(t){return function(e){return t.apply(this,e)}},n.CancelToken="function"==typeof AbortController?AbortController:Object,n.defaults=e,n.create=t,n}());
//# sourceMappingURL=redaxios.module.js.map

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.redaxios=t()}(this,function(){return function e(t){function r(e){return function(t,r){return a(t,Object.assign({method:e},r))}}function o(e){return function(t,r,o){return a(t,Object.assign({method:e,data:r},o))}}function n(e,t,r){if(Array.isArray(e))return e.concat(t);if(t&&"object"==typeof t){var o,a={};if(e)for(o in e)a[r?o.toLowerCase():o]=e[o];for(o in t){var i=r?o.toLowerCase():o;"headers"===i&&(r=!0),a[i]=o in a?n(a[i],t[o],r):t[o]}return a}return t}function a(e,r){"string"!=typeof e&&(e=(r=e).url);var o=n(t,r||{}),a=o.data;if(o.transformRequest)for(var i=0;i<o.transformRequest.length;i++){var s=o.transformRequest[i](a,o.headers);void 0!==s&&(a=s)}var f={};if(a&&"object"==typeof a&&(a=JSON.stringify(a),f["Content-Type"]="application/json"),o.xsrfCookieName)for(var u=document.cookie.split(/ *[;=] */),c=0;c<u.length;c+=2)if(u[c]==o.xsrfCookieName){f[o.xsrfHeaderName]=decodeURIComponent(u[c+1]);break}o.auth&&(f.Authorization=o.auth);var d={};return d.config=r,fetch(e,{method:o.method,body:a,headers:n(o.headers,f,!0)}).then(function(e){var t;for(t in e)"function"!=typeof e[t]&&(d[t]=e[t]);return(o.validateStatus?o.validateStatus(e.status):e.ok)?("stream"===o.responseType?Promise.resolve(e.body):e[o.responseType||"text"]()).then(function(e){return d.data=e,d}):Promise.reject(e)})}return t=t||{},a.request=a,a.get=r("get"),a.delete=r("delete"),a.options=r("options"),a.post=o("post"),a.put=o("put"),a.patch=o("patch"),a.all=Promise.all,a.spread=function(e){return function(t){return e.apply(this,t)}},a.CancelToken=self.AbortController||Object,a.create=e,a}()});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.redaxios=t()}(this,function(){return function e(t){function n(e,t,r){var o,a={};if(Array.isArray(e))return e.concat(t);for(o in e)a[r?o.toLowerCase():o]=e[o];for(o in t){var i=r?o.toLowerCase():o,u=t[o];a[i]=i in a&&"object"==typeof u?n(a[i],u,"headers"===i):u}return a}function r(e,r,o,a){"string"!=typeof e&&(e=(r=e).url);var i={config:r},u=n(t,r),f={},s=a||u.data;(u.transformRequest||[]).map(function(e){s=e(s,u.headers)||s}),s&&"object"==typeof s&&"function"!=typeof s.append&&(s=JSON.stringify(s),f["content-type"]="application/json");var c=document.cookie.match(RegExp("(^|; )"+u.xsrfCookieName+"=([^;]*)"));if(c&&(f[u.xsrfHeaderName]=c[2]),u.auth&&(f.authorization=u.auth),u.baseURL&&(e=new URL(e,u.baseURL)+""),u.params){var p=~e.indexOf("?")?"&":"?";e+=p+(u.paramsSerializer?u.paramsSerializer(u.params):new URLSearchParams(u.params))}return(u.fetch||fetch)(e,{method:o||u.method,body:s,headers:n(u.headers,f,!0),credentials:u.withCredentials?"include":void 0}).then(function(e){for(var t in e)"function"!=typeof e[t]&&(i[t]=e[t]);return(u.validateStatus?u.validateStatus(e.status):e.ok)?"stream"==u.responseType?(i.data=e.body,i):e[u.responseType||"text"]().then(function(e){i.data=e,i.data=JSON.parse(e)}).catch(Object).then(function(){return i}):Promise.reject(i)})}return t=t||{},r.request=r,r.get=function(e,t){return r(e,t,"get")},r.delete=function(e,t){return r(e,t,"delete")},r.options=function(e,t){return r(e,t,"options")},r.post=function(e,t,n){return r(e,n,"post",t)},r.put=function(e,t,n){return r(e,n,"put",t)},r.patch=function(e,t,n){return r(e,n,"patch",t)},r.all=Promise.all,r.spread=function(e){return function(t){return e.apply(this,t)}},r.CancelToken="function"==typeof AbortController?AbortController:Object,r.defaults=t,r.create=e,r}()});
//# sourceMappingURL=redaxios.umd.js.map
{
"name": "redaxios",
"version": "0.2.0",
"version": "0.3.0",
"description": "The API from Axios, as a tiny abstraction over Fetch.",

@@ -9,6 +9,9 @@ "source": "src/index.js",

"module": "dist/redaxios.module.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "microbundle",
"test": "eslint src test && karmatic",
"release": "npm t && git commit -am \"$npm_package_version\" && git tag $npm_package_version && git push && git push --tags && npm publish"
"build": "microbundle && tsc",
"test": "npm run format:check && eslint src test && karmatic",
"release": "npm t && git commit -am \"$npm_package_version\" && git tag $npm_package_version && git push && git push --tags && npm publish",
"format": "prettier --write './**/*.{js,json,yml,md}'",
"format:check": "prettier --check './**/*.{js,json,yml,md}'"
},

@@ -20,4 +23,28 @@ "files": [

"eslintConfig": {
"extends": "developit"
"extends": [
"developit",
"prettier"
],
"rules": {
"jest/no-jasmine-globals": "off"
}
},
"prettier": {
"arrowParens": "always",
"trailingComma": "none",
"singleQuote": true,
"endOfLine": "lf",
"useTabs": true,
"printWidth": 120,
"overrides": [
{
"files": "**/*.json",
"options": {
"parser": "json-stringify",
"useTabs": false,
"tabWidth": 2
}
}
]
},
"repository": "developit/redaxios",

@@ -32,11 +59,16 @@ "keywords": [

"devDependencies": {
"eslint": "^6.8.0",
"eslint-config-developit": "^1.1.1",
"@types/jest": "^26.0.4",
"core-js": "2.6.11",
"eslint": "^7.5.0",
"eslint-config-developit": "^1.2.0",
"eslint-config-prettier": "6.11.0",
"file-loader": "^5.0.2",
"jest": "^24.9.0",
"karmatic": "^1.4.0",
"isomorphic-fetch": "^2.2.1",
"karmatic": "^2.1.0",
"microbundle": "^0.11.0",
"sinon": "^8.0.4",
"npm-merge-driver-install": "^1.1.1",
"prettier": "2.0.5",
"typescript": "3.9.3",
"webpack": "^4.41.5"
}
}
}

@@ -18,6 +18,9 @@ /**

* @property {string} [url] the URL to request
* @property {string} [method="get"] HTTP method, case-insensitive
* @property {'get'|'post'|'put'|'patch'|'delete'|'options'|'head'|'GET'|'POST'|'PUT'|'PATCH'|'DELETE'|'OPTIONS'|'HEAD'} [method="get"] HTTP method, case-insensitive
* @property {Headers} [headers] Request headers
* @property {FormData|string|object} [body] a body, optionally encoded, to send
* @property {'text'|'json'|'stream'|'blob'|'arrayBuffer'|'formData'|'stream'} [responseType="text"] An encoding to use for the response
* @property {'text'|'json'|'stream'|'blob'|'arrayBuffer'|'formData'|'stream'} [responseType="json"] An encoding to use for the response
* @property {Record<string,any>|URLSearchParams} [params] querystring parameters
* @property {(params: Options['params']) => string} [paramsSerializer] custom function to stringify querystring parameters
* @property {boolean} [withCredentials] Send the request with credentials like cookies
* @property {string} [auth] Authorization header value to send with the request

@@ -28,2 +31,5 @@ * @property {string} [xsrfCookieName] Pass an Cross-site Request Forgery prevention cookie value as a header defined by `xsrfHeaderName`

* @property {Array<(body: any, headers: Headers) => any?>} [transformRequest] An array of transformations to apply to the outgoing request
* @property {string} [baseURL] a base URL from which to resolve all URLs
* @property {typeof window.fetch} [fetch] Custom window.fetch implementation
* @property {any} [data]
*/

@@ -39,54 +45,54 @@

* @public
* @template T
* @typedef Response
* @property {number} status
* @property {string} statusText
* @property {Options} config the request configuration
* @property {any} data the decoded response body
* @property {T} data the decoded response body
* @property {Headers} headers
* @property {boolean} redirect
* @property {string} url
* @property {ResponseType} type
* @property {ReadableStream<Uint8Array> | null} body
* @property {boolean} bodyUsed
*/
/**
* @typedef BodylessMethod
* @type {<T=any>(url: string, config?: Options) => Promise<Response<T>>}
*/
/**
* @typedef BodyMethod
* @type {<T=any>(url: string, body?: any, config?: Options) => Promise<Response<T>>}
*/
/** */
export default (function create(defaults) {
export default (function create(/** @type {Options} */ defaults) {
defaults = defaults || {};
/**
* Creates a request factory bound to the given HTTP method.
* @private
* @param {string} method
* @returns {(url: string, config?: Options) => Promise<Response>}
*/
function createBodylessMethod(method) {
return (url, config) => redaxios(url, Object.assign({ method }, config));
}
/**
* Creates a request factory bound to the given HTTP method.
* @private
* @param {string} method
* @returns {(url: string, body?: any, config?: Options) => Promise<Response>}
*/
function createBodyMethod(method) {
return (url, data, config) => redaxios(url, Object.assign({ method, data }, config));
}
/**
* @public
* @type {((config?: Options) => Promise<Response>) | ((url: string, config?: Options) => Promise<Response>)}
* @template T
* @type {(<T = any>(config?: Options) => Promise<Response<T>>) | (<T = any>(url: string, config?: Options) => Promise<Response<T>>)}
*/
redaxios.request = redaxios;
/** @public */
redaxios.get = createBodylessMethod('get');
/** @public @type {BodylessMethod} */
redaxios.get = (url, config) => redaxios(url, config, 'get');
/** @public */
redaxios.delete = createBodylessMethod('delete');
/** @public @type {BodylessMethod} */
redaxios.delete = (url, config) => redaxios(url, config, 'delete');
/** @public */
redaxios.options = createBodylessMethod('options');
/** @public @type {BodylessMethod} */
redaxios.options = (url, config) => redaxios(url, config, 'options');
/** @public */
redaxios.post = createBodyMethod('post');
/** @public @type {BodyMethod} */
redaxios.post = (url, data, config) => redaxios(url, config, 'post', data);
/** @public */
redaxios.put = createBodyMethod('put');
/** @public @type {BodyMethod} */
redaxios.put = (url, data, config) => redaxios(url, config, 'put', data);
/** @public */
redaxios.patch = createBodyMethod('patch');
/** @public @type {BodyMethod} */
redaxios.patch = (url, data, config) => redaxios(url, config, 'patch', data);

@@ -96,4 +102,9 @@ /** @public */

/** @public */
redaxios.spread = function(fn) {
/**
* @public
* @template T,R
* @param {(...args: T[]) => R} fn
* @returns {(array: T[]) => R}
*/
redaxios.spread = function (fn) {
return function (results) {

@@ -103,23 +114,28 @@ return fn.apply(this, results);

};
// 3b smaller:
// redaxios.spread = (fn) => /** @type {any} */ (fn.apply.bind(fn, fn));
/**
* @private
* @param {Record<string,any>} opts
* @param {Record<string,any>} [overrides]
* @param {boolean} [lowerCase]
* @returns {Partial<opts>}
*/
function deepMerge(opts, overrides, lowerCase) {
let out = {},
i;
if (Array.isArray(opts)) {
return opts.concat(overrides);
}
if (overrides && typeof overrides == 'object') {
let out = {}, i;
if (opts) {
for (i in opts) {
let key = lowerCase ? i.toLowerCase() : i;
out[key] = opts[i];
}
}
for (i in overrides) {
let key = lowerCase ? i.toLowerCase() : i;
if (key === 'headers') lowerCase = true;
out[key] = i in out ? deepMerge(out[key], overrides[i], lowerCase) : overrides[i];
}
return out;
for (i in opts) {
const key = lowerCase ? i.toLowerCase() : i;
out[key] = opts[i];
}
return overrides;
for (i in overrides) {
const key = lowerCase ? i.toLowerCase() : i;
const value = /** @type {any} */ (overrides)[i];
out[key] = key in out && typeof value == 'object' ? deepMerge(out[key], value, key === 'headers') : value;
}
return out;
}

@@ -130,7 +146,10 @@

* @public
* @param {string} [url]
* @template T
* @param {string | Options} url
* @param {Options} [config]
* @returns {Promise<Response>}
* @param {any} [_method]
* @param {any} [_data]
* @returns {Promise<Response<T>>}
*/
function redaxios(url, config) {
function redaxios(url, config, _method, _data) {
if (typeof url !== 'string') {

@@ -140,63 +159,87 @@ config = url;

}
const options = deepMerge(defaults, config || {});
let data = options.data;
if (options.transformRequest) {
for (let i = 0; i < options.transformRequest.length; i++) {
let r = options.transformRequest[i](data, options.headers);
if (r !== undefined) {
data = r;
}
}
}
const response = /** @type {Response<any>} */ ({ config });
/** @type {Options} */
const options = deepMerge(defaults, config);
/** @type {Headers} */
const customHeaders = {};
if (data && typeof data === 'object') {
let data = _data || options.data;
(options.transformRequest || []).map((f) => {
data = f(data, options.headers) || data;
});
if (data && typeof data === 'object' && typeof data.append !== 'function') {
data = JSON.stringify(data);
customHeaders['Content-Type'] = 'application/json';
customHeaders['content-type'] = 'application/json';
}
if (options.xsrfCookieName) {
let parts = document.cookie.split(/ *[;=] */);
for (let i = 0; i < parts.length; i += 2) {
if (parts[i] == options.xsrfCookieName) {
customHeaders[options.xsrfHeaderName] = decodeURIComponent(parts[i+1]);
break;
}
}
}
const m = document.cookie.match(RegExp('(^|; )' + options.xsrfCookieName + '=([^;]*)'));
if (m) customHeaders[options.xsrfHeaderName] = m[2];
if (options.auth) {
customHeaders.Authorization = options.auth;
customHeaders.authorization = options.auth;
}
/** @type {Response} */
const response = {};
response.config = config;
if (options.baseURL) {
url = new URL(url, options.baseURL) + '';
}
return fetch(url, {
method: options.method,
if (options.params) {
const divider = ~url.indexOf('?') ? '&' : '?';
const query = options.paramsSerializer
? options.paramsSerializer(options.params)
: new URLSearchParams(options.params);
url += divider + query;
}
const fetchFunc = options.fetch || fetch;
return fetchFunc(url, {
method: _method || options.method,
body: data,
headers: deepMerge(options.headers, customHeaders, true)
headers: deepMerge(options.headers, customHeaders, true),
credentials: options.withCredentials ? 'include' : undefined
}).then((res) => {
let i;
for (i in res) {
for (const i in res) {
if (typeof res[i] != 'function') response[i] = res[i];
}
if (!(options.validateStatus ? options.validateStatus(res.status) : res.ok)) {
return Promise.reject(res);
const ok = options.validateStatus ? options.validateStatus(res.status) : res.ok;
if (!ok) return Promise.reject(response);
if (options.responseType == 'stream') {
response.data = res.body;
return response;
}
const withData = options.responseType === 'stream'
? Promise.resolve(res.body)
: res[options.responseType || 'text']();
return withData.then((data) => {
response.data = data;
return response;
});
return res[options.responseType || 'text']()
.then((data) => {
response.data = data;
// its okay if this fails: response.data will be the unparsed value:
response.data = JSON.parse(data);
})
.catch(Object)
.then(() => response);
});
}
redaxios.CancelToken = self.AbortController || Object;
/**
* @public
* @type {AbortController}
*/
redaxios.CancelToken = /** @type {any} */ (typeof AbortController == 'function' ? AbortController : Object);
/**
* @public
* @type {Options}
*/
redaxios.defaults = defaults;
/**
* @public
*/
redaxios.create = create;

@@ -203,0 +246,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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