Socket
Socket
Sign inDemoInstall

sinon

Package Overview
Dependencies
Maintainers
4
Versions
206
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sinon - npm Package Compare versions

Comparing version 15.0.1 to 15.0.2

2

lib/sinon/default-behaviors.js

@@ -34,2 +34,4 @@ "use strict";

fake.fakeFn = fn;
fake.exception = undefined;
fake.exceptionCreator = undefined;
},

@@ -36,0 +38,0 @@

@@ -134,4 +134,9 @@ "use strict";

var stubbedObject = stub(Object.create(constructor.prototype));
// eslint-disable-next-line no-empty-function
const noop = () => {};
const defaultNoOpInstance = Object.create(constructor.prototype);
walkObject((obj, prop) => (obj[prop] = noop), defaultNoOpInstance);
const stubbedObject = stub(defaultNoOpInstance);
forEach(Object.keys(overrides || {}), function (propertyName) {

@@ -138,0 +143,0 @@ if (propertyName in stubbedObject) {

20

lib/sinon/util/core/walk-object.js

@@ -8,5 +8,13 @@ "use strict";

function walkObject(predicate, object, filter) {
/**
* A utility that allows traversing an object, applying mutating functions on the properties
*
* @param {Function} mutator called on each property
* @param {object} object the object we are walking over
* @param {Function} filter a predicate (boolean function) that will decide whether or not to apply the mutator to the current property
* @returns {void} nothing
*/
function walkObject(mutator, object, filter) {
var called = false;
var name = functionName(predicate);
var name = functionName(mutator);

@@ -30,7 +38,7 @@ if (!object) {

called = true;
predicate(object, prop);
mutator(object, prop);
}
} else {
called = true;
predicate(object, prop);
mutator(object, prop);
}

@@ -41,3 +49,5 @@ }

if (!called) {
throw new Error(`Expected to ${name} methods on object but found none`);
throw new Error(
`Found no methods on object to which we could apply mutations`
);
}

@@ -44,0 +54,0 @@

@@ -18,3 +18,3 @@ {

],
"version": "15.0.1",
"version": "15.0.2",
"homepage": "https://sinonjs.org/",

@@ -77,14 +77,14 @@ "author": "Christian Johansen",

"dependencies": {
"@sinonjs/commons": "^2.0.0",
"@sinonjs/fake-timers": "10.0.2",
"@sinonjs/commons": "^3.0.0",
"@sinonjs/fake-timers": "^10.0.2",
"@sinonjs/samsam": "^7.0.1",
"diff": "^5.0.0",
"nise": "^5.1.2",
"diff": "^5.1.0",
"nise": "^5.1.4",
"supports-color": "^7.2.0"
},
"devDependencies": {
"@babel/core": "^7.16.12",
"@sinonjs/eslint-config": "^4.0.5",
"@babel/core": "^7.21.0",
"@sinonjs/eslint-config": "^4.0.6",
"@sinonjs/eslint-plugin-no-prototype-methods": "^0.1.1",
"@sinonjs/referee": "^9.1.1",
"@sinonjs/referee": "^10.0.0",
"@studio/changes": "^2.2.0",

@@ -94,18 +94,18 @@ "babel-plugin-istanbul": "^6.1.1",

"browserify": "^16.5.2",
"debug": "^4.3.1",
"debug": "^4.3.4",
"dependency-check": "^4.1.0",
"husky": "^6.0.0",
"lint-staged": "^12.3.2",
"mocha": "^9.2.0",
"mochify": "^9.1.0",
"lint-staged": "^13.2.0",
"mocha": "^10.2.0",
"mochify": "^9.2.0",
"nyc": "^15.1.0",
"prettier": "^2.5.1",
"prettier": "^2.8.4",
"proxyquire": "^2.1.3",
"proxyquire-universal": "^3.0.1",
"proxyquireify": "^3.2.1",
"puppeteer": "^13.1.2",
"rimraf": "^3.0.2",
"semver": "^7.3.5",
"shelljs": "^0.8.4",
"unimported": "^1.20.0"
"puppeteer": "^19.7.4",
"rimraf": "^4.4.0",
"semver": "^7.3.8",
"shelljs": "^0.8.5",
"unimported": "^1.26.0"
},

@@ -112,0 +112,0 @@ "files": [

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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