Socket
Socket
Sign inDemoInstall

axios-mock-adapter

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

axios-mock-adapter - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

2

dist/axios-mock-adapter.js

@@ -60,3 +60,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

function findHandler(matchers, method, url) {
return matchers[method].find(function(matcher) {
return matchers[method.toLowerCase()].find(function(matcher) {
if (typeof matcher[0] === 'string') {

@@ -63,0 +63,0 @@ return url === matcher[0];

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

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.AxiosMockAdapter=e():t.AxiosMockAdapter=e()}(this,function(){return function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return t[o].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e){function n(t,e,n){return t[e].find(function(t){return"string"==typeof t[0]?n===t[0]:t[0]instanceof RegExp?t[0].test(n):void 0})}function o(){return function(t,e,o){var r=n(this.matchers,o.method,o.url);if(r){var i=r[1]instanceof Function?r[1](o):r.slice(1);(1223===i[0]||i[0]>=200&&i[0]<300?t:e)({status:i[0],data:i[1],headers:i[2],config:o})}else e({status:404,config:o})}.bind(this)}function r(){this.matchers=s.reduce(function(t,e){return t[e]=[],t},{})}function i(t){r.call(this),t&&(this.axiosInstance=t,this.originalAdapter=t.defaults.adapter,t.defaults.adapter=o.call(this))}var s=["get","post","head","delete","patch","put"];i.prototype.adapter=o,i.prototype.onAny=function(t){var e=this;return{reply:function(n,o,r){var i=[t,n,o,r];return s.forEach(function(t){e.matchers[t].push(i)}),e}}},i.prototype.restore=function(){this.axiosInstance&&(this.axiosInstance.defaults.adapter=this.originalAdapter)},i.prototype.reset=r,s.forEach(function(t){var e="on"+t.charAt(0).toUpperCase()+t.slice(1);i.prototype[e]=function(e){var n=this;return{reply:function(o,r,i){return n.matchers[t].push([e,o,r,i]),n}}}}),t.exports=i}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.AxiosMockAdapter=e():t.AxiosMockAdapter=e()}(this,function(){return function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return t[o].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e){function n(t,e,n){return t[e.toLowerCase()].find(function(t){return"string"==typeof t[0]?n===t[0]:t[0]instanceof RegExp?t[0].test(n):void 0})}function o(){return function(t,e,o){var r=n(this.matchers,o.method,o.url);if(r){var i=r[1]instanceof Function?r[1](o):r.slice(1);(1223===i[0]||i[0]>=200&&i[0]<300?t:e)({status:i[0],data:i[1],headers:i[2],config:o})}else e({status:404,config:o})}.bind(this)}function r(){this.matchers=s.reduce(function(t,e){return t[e]=[],t},{})}function i(t){r.call(this),t&&(this.axiosInstance=t,this.originalAdapter=t.defaults.adapter,t.defaults.adapter=o.call(this))}var s=["get","post","head","delete","patch","put"];i.prototype.adapter=o,i.prototype.onAny=function(t){var e=this;return{reply:function(n,o,r){var i=[t,n,o,r];return s.forEach(function(t){e.matchers[t].push(i)}),e}}},i.prototype.restore=function(){this.axiosInstance&&(this.axiosInstance.defaults.adapter=this.originalAdapter)},i.prototype.reset=r,s.forEach(function(t){var e="on"+t.charAt(0).toUpperCase()+t.slice(1);i.prototype[e]=function(e){var n=this;return{reply:function(o,r,i){return n.matchers[t].push([e,o,r,i]),n}}}}),t.exports=i}])});
var verbs = ['get', 'post', 'head', 'delete', 'patch', 'put'];
function findHandler(matchers, method, url) {
return matchers[method].find(function(matcher) {
return matchers[method.toLowerCase()].find(function(matcher) {
if (typeof matcher[0] === 'string') {

@@ -6,0 +6,0 @@ return url === matcher[0];

{
"name": "axios-mock-adapter",
"version": "1.3.0",
"version": "1.3.1",
"description": "Axios adapter that allows to easily mock requests",

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

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