Socket
Socket
Sign inDemoInstall

fetch-mock

Package Overview
Dependencies
Maintainers
1
Versions
226
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fetch-mock - npm Package Compare versions

Comparing version 5.0.1 to 5.0.2

16

es5/client-browserified.js

@@ -20,2 +20,4 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.fetchMock = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

@@ -179,3 +181,3 @@

} else if (options) {
route = Object.assign({
route = _extends({
matcher: matcher,

@@ -202,3 +204,3 @@ response: response

value: function get(matcher, response, options) {
return this.mock(matcher, response, Object.assign({}, options, { method: 'GET' }));
return this.mock(matcher, response, _extends({}, options, { method: 'GET' }));
}

@@ -208,3 +210,3 @@ }, {

value: function post(matcher, response, options) {
return this.mock(matcher, response, Object.assign({}, options, { method: 'POST' }));
return this.mock(matcher, response, _extends({}, options, { method: 'POST' }));
}

@@ -214,3 +216,3 @@ }, {

value: function put(matcher, response, options) {
return this.mock(matcher, response, Object.assign({}, options, { method: 'PUT' }));
return this.mock(matcher, response, _extends({}, options, { method: 'PUT' }));
}

@@ -220,3 +222,3 @@ }, {

value: function _delete(matcher, response, options) {
return this.mock(matcher, response, Object.assign({}, options, { method: 'DELETE' }));
return this.mock(matcher, response, _extends({}, options, { method: 'DELETE' }));
}

@@ -226,3 +228,3 @@ }, {

value: function head(matcher, response, options) {
return this.mock(matcher, response, Object.assign({}, options, { method: 'HEAD' }));
return this.mock(matcher, response, _extends({}, options, { method: 'HEAD' }));
}

@@ -487,3 +489,3 @@ }, {

value: function configure(opts) {
Object.assign(this.config, opts);
_extends(this.config, opts);
}

@@ -490,0 +492,0 @@ }]);

@@ -5,2 +5,4 @@ 'use strict';

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

@@ -164,3 +166,3 @@

} else if (options) {
route = Object.assign({
route = _extends({
matcher: matcher,

@@ -187,3 +189,3 @@ response: response

value: function get(matcher, response, options) {
return this.mock(matcher, response, Object.assign({}, options, { method: 'GET' }));
return this.mock(matcher, response, _extends({}, options, { method: 'GET' }));
}

@@ -193,3 +195,3 @@ }, {

value: function post(matcher, response, options) {
return this.mock(matcher, response, Object.assign({}, options, { method: 'POST' }));
return this.mock(matcher, response, _extends({}, options, { method: 'POST' }));
}

@@ -199,3 +201,3 @@ }, {

value: function put(matcher, response, options) {
return this.mock(matcher, response, Object.assign({}, options, { method: 'PUT' }));
return this.mock(matcher, response, _extends({}, options, { method: 'PUT' }));
}

@@ -205,3 +207,3 @@ }, {

value: function _delete(matcher, response, options) {
return this.mock(matcher, response, Object.assign({}, options, { method: 'DELETE' }));
return this.mock(matcher, response, _extends({}, options, { method: 'DELETE' }));
}

@@ -211,3 +213,3 @@ }, {

value: function head(matcher, response, options) {
return this.mock(matcher, response, Object.assign({}, options, { method: 'HEAD' }));
return this.mock(matcher, response, _extends({}, options, { method: 'HEAD' }));
}

@@ -472,3 +474,3 @@ }, {

value: function configure(opts) {
Object.assign(this.config, opts);
_extends(this.config, opts);
}

@@ -475,0 +477,0 @@ }]);

{
"name": "fetch-mock",
"version": "5.0.1",
"version": "5.0.2",
"description": "Mock http requests made using fetch (or isomorphic-fetch)",

@@ -10,3 +10,3 @@ "main": "src/server.js",

"browserify": "browserify -s fetchMock src/client.js > es5/client-browserified.js",
"prepublish": "babel src --out-dir es5 --presets es2015 && npm run browserify"
"prepublish": "babel src --out-dir es5 --plugins transform-object-assign --presets es2015 && npm run browserify"
},

@@ -36,2 +36,3 @@ "repository": {

"babel-cli": "^6.1.2",
"babel-plugin-transform-object-assign": "^6.8.0",
"babel-preset-es2015": "^6.1.2",

@@ -59,2 +60,5 @@ "babelify": "^7.2.0",

{
"plugins": [
"transform-object-assign"
],
"presets": [

@@ -61,0 +65,0 @@ "es2015"

@@ -776,3 +776,3 @@ 'use strict';

describe.only('regressions', () => {
describe('regressions', () => {
it('should accept object respones when passing options', () => {

@@ -779,0 +779,0 @@

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