Comparing version 11.1.2 to 12.0.0
@@ -11,3 +11,3 @@ "use strict"; | ||
/** | ||
* Returns a fake for a given function or undefined. If no functino is given, a | ||
* Returns a fake for a given function or undefined. If no function is given, a | ||
* new fake is returned. If the given function is already a fake, it is | ||
@@ -14,0 +14,0 @@ * returned as is. Otherwise the given function is wrapped in a new fake. |
@@ -123,12 +123,12 @@ "use strict"; | ||
return (format || "").replace(/%(.)/g, function (match, specifyer) { | ||
formatter = proxyApi.formatters[specifyer]; | ||
return (format || "").replace(/%(.)/g, function (match, specifier) { | ||
formatter = proxyApi.formatters[specifier]; | ||
if (typeof formatter === "function") { | ||
return String(formatter(spyInstance, args)); | ||
} else if (!isNaN(parseInt(specifyer, 10))) { | ||
return sinonFormat(args[specifyer - 1]); | ||
} else if (!isNaN(parseInt(specifier, 10))) { | ||
return sinonFormat(args[specifier - 1]); | ||
} | ||
return `%${specifyer}`; | ||
return `%${specifier}`; | ||
}); | ||
@@ -135,0 +135,0 @@ }, |
@@ -75,8 +75,10 @@ "use strict"; | ||
) { | ||
if (calledArgs[j]) { | ||
calledArgs[j] = quoteStringValue(calledArgs[j]); | ||
var calledArg = calledArgs[j]; | ||
var expectedArg = expectedArgs[j]; | ||
if (calledArg) { | ||
calledArg = quoteStringValue(calledArg); | ||
} | ||
if (expectedArgs[j]) { | ||
expectedArgs[j] = quoteStringValue(expectedArgs[j]); | ||
if (expectedArg) { | ||
expectedArg = quoteStringValue(expectedArg); | ||
} | ||
@@ -87,7 +89,7 @@ | ||
var calledArgMessage = | ||
j < calledArgs.length ? sinonFormat(calledArgs[j]) : ""; | ||
if (match.isMatcher(expectedArgs[j])) { | ||
j < calledArgs.length ? sinonFormat(calledArg) : ""; | ||
if (match.isMatcher(expectedArg)) { | ||
message += colorSinonMatchText( | ||
expectedArgs[j], | ||
calledArgs[j], | ||
expectedArg, | ||
calledArg, | ||
calledArgMessage | ||
@@ -97,5 +99,3 @@ ); | ||
var expectedArgMessage = | ||
j < expectedArgs.length | ||
? sinonFormat(expectedArgs[j]) | ||
: ""; | ||
j < expectedArgs.length ? sinonFormat(expectedArg) : ""; | ||
var diff = jsDiff.diffJson( | ||
@@ -102,0 +102,0 @@ calledArgMessage, |
@@ -111,3 +111,3 @@ "use strict"; | ||
if the sorce has an Accessor property copy over the accessor functions (get and set) | ||
data properties has writable attribute where as acessor property don't | ||
data properties has writable attribute where as accessor property don't | ||
REF: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#properties | ||
@@ -114,0 +114,0 @@ */ |
@@ -18,3 +18,3 @@ { | ||
], | ||
"version": "11.1.2", | ||
"version": "12.0.0", | ||
"homepage": "https://sinonjs.org/", | ||
@@ -47,6 +47,6 @@ "author": "Christian Johansen", | ||
"check-dependencies": "dependency-check package.json --no-dev --ignore-module esm", | ||
"build": "node ./build.js", | ||
"build": "node ./build.cjs", | ||
"build-docs": "cd docs; bundle exec jekyll build", | ||
"serve-docs": "cd docs; bundle exec jekyll serve --incremental --verbose", | ||
"lint": "eslint '**/*.{js,mjs}'", | ||
"lint": "eslint '**/*.{js,cjs,mjs}'", | ||
"pretest-webworker": "npm run build", | ||
@@ -60,2 +60,3 @@ "prebuild": "rimraf pkg && npm run check-dependencies", | ||
"preversion": "./scripts/preversion.sh", | ||
"version": "changes --commits --footer", | ||
"postversion": "./scripts/postversion.sh" | ||
@@ -78,3 +79,3 @@ }, | ||
"@sinonjs/commons": "^1.8.3", | ||
"@sinonjs/fake-timers": "^7.1.2", | ||
"@sinonjs/fake-timers": "^8.1.0", | ||
"@sinonjs/samsam": "^6.0.2", | ||
@@ -90,2 +91,3 @@ "diff": "^5.0.0", | ||
"@sinonjs/referee": "^8.0.2", | ||
"@studio/changes": "^2.2.0", | ||
"babel-plugin-istanbul": "^6.0.0", | ||
@@ -123,2 +125,7 @@ "babelify": "^10.0.0", | ||
"module": "./pkg/sinon-esm.js", | ||
"exports": { | ||
"require": "./pkg/sinon.cjs", | ||
"import": "./pkg/sinon-esm.js" | ||
}, | ||
"type": "module", | ||
"cdn": "./pkg/sinon.js", | ||
@@ -125,0 +132,0 @@ "jsdelivr": "./pkg/sinon.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
7815743
88955
0
0
Yes
23
53
+ Added@sinonjs/fake-timers@8.1.0(transitive)
- Removed@sinonjs/fake-timers@7.1.2(transitive)
Updated@sinonjs/fake-timers@^8.1.0