Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sinon

Package Overview
Dependencies
Maintainers
4
Versions
208
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 8.0.2 to 8.0.3

5

CHANGELOG.md
8.0.3 / 2020-01-06
==================
* Move .printf to proxy
8.0.2 / 2019-12-30

@@ -3,0 +8,0 @@ ==================

@@ -9,2 +9,3 @@ "use strict";

var proxyInvoke = require("./proxy-invoke");
var sinonFormat = require("./util/core/format");

@@ -106,2 +107,21 @@ var push = arrayProto.push;

formatters: require("./spy-formatters"),
printf: function(format) {
var spyInstance = this;
var args = slice(arguments, 1);
var formatter;
return (format || "").replace(/%(.)/g, function(match, specifyer) {
formatter = proxyApi.formatters[specifyer];
if (typeof formatter === "function") {
return String(formatter(spyInstance, args));
} else if (!isNaN(parseInt(specifyer, 10))) {
return sinonFormat(args[specifyer - 1]);
}
return "%" + specifyer;
});
},
resetHistory: function() {

@@ -108,0 +128,0 @@ if (this.invoking) {

21

lib/sinon/spy.js

@@ -13,3 +13,2 @@ "use strict";

var wrapMethod = require("./util/core/wrap-method");
var sinonFormat = require("./util/core/format");
var valueToString = require("@sinonjs/commons").valueToString;

@@ -36,4 +35,2 @@

var spyApi = {
formatters: require("./spy-formatters"),
withArgs: function() {

@@ -79,20 +76,2 @@ var args = slice(arguments);

});
},
printf: function(format) {
var spyInstance = this;
var args = slice(arguments, 1);
var formatter;
return (format || "").replace(/%(.)/g, function(match, specifyer) {
formatter = spyApi.formatters[specifyer];
if (typeof formatter === "function") {
return String(formatter(spyInstance, args));
} else if (!isNaN(parseInt(specifyer, 10))) {
return sinonFormat(args[specifyer - 1]);
}
return "%" + specifyer;
});
}

@@ -99,0 +78,0 @@ };

8

package.json
{
"name": "sinon",
"description": "JavaScript test spies, stubs and mocks.",
"version": "8.0.2",
"version": "8.0.3",
"homepage": "https://sinonjs.org/",

@@ -70,3 +70,3 @@ "author": "Christian Johansen",

"@sinonjs/referee": "^4.0.0",
"babel-plugin-istanbul": "^5.2.0",
"babel-plugin-istanbul": "^6.0.0",
"babelify": "^10.0.0",

@@ -85,7 +85,7 @@ "browserify": "^16.5.0",

"lint-staged": "^9.4.1",
"markdownlint-cli": "^0.18.0",
"markdownlint-cli": "^0.20.0",
"mocha": "^6.2.0",
"mochify": "^6.6.0",
"npm-run-all": "^4.1.5",
"nyc": "^14.1.1",
"nyc": "^15.0.0",
"prettier": "^1.18.2",

@@ -92,0 +92,0 @@ "proxyquire": "^2.1.3",

Sorry, the diff of this file is not supported yet

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

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

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