New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.0 to 1.0.1

2

package.json
{
"name": "compare-module-exports",
"version": "1.0.0",
"version": "1.0.1",
"description": "",

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

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

if (typeOfA !== typeOfB) {
throw new Error(libraryName + ': exported type mismatch: ' + file + ':' + name + '. Expected ' + typeOfB + ', got ' + typeOfB + '');
throw new Error(libraryName + ': exported type mismatch: ' + file + ':' + name + '. Expected ' + typeOfA + ', got ' + typeOfB + '');
}

@@ -29,7 +29,18 @@ if (typeOfA === 'function') {

hasError = false;
if (typeof mockedExports !== typeof realExports) {
throw new Error(libraryName + ': mock ' + mockFile + ' export does not match real file');
const typeOfA = typeof mockedExports;
const typeOfB = typeof realExports
if (typeOfA !== typeOfB) {
console.error(
libraryName + ': mock ' + mockFile + ' exports does not match a real file.' +
' Expected ' + typeOfA + ', got ' + typeOfB + ''
);
return true;
}
if (typeof mockedExports === 'function') {
test(mockedExports, realExports, realFile, 'exports');
try {
test(mockedExports, realExports, realFile, 'exports');
} catch (e) {
console.error(e.message, '\n');
hasError = true;
}
} else if (typeof mockedExports === 'object') {

@@ -36,0 +47,0 @@ Object.keys(mockedExports).forEach(key => {

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