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

compare-module-exports

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

compare-module-exports - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

package.json
{
"name": "compare-module-exports",
"version": "1.0.2",
"version": "1.0.3",
"description": "",

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

@@ -14,3 +14,3 @@ function generate(libraryName) {

function test(a, b, file, name) {
function test(a, b, file, name, options) {
if (!b) {

@@ -25,7 +25,9 @@ throw new Error(libraryName + ': mocked export "' + name + '" does not exists in ' + file);

if (typeOfA === 'function') {
return testFunction(a, b, file, name);
if (!options.noFunctionCompare) {
return testFunction(a, b, file, name);
}
}
}
function matchExports(realExports, mockedExports, realFile, mockFile) {
function matchExports(realExports, mockedExports, realFile, mockFile, options = {}) {
hasError = false;

@@ -43,3 +45,3 @@ const typeOfA = typeof mockedExports;

try {
test(mockedExports, realExports, realFile, 'exports');
test(mockedExports, realExports, realFile, 'exports', options);
} catch (e) {

@@ -52,3 +54,3 @@ console.error(e.message, '\n');

try {
test(mockedExports[key], realExports[key], realFile, key)
test(mockedExports[key], realExports[key], realFile, key, options)
} catch (e) {

@@ -55,0 +57,0 @@ console.error(e.message, '\n');

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