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

esmock

Package Overview
Dependencies
Maintainers
1
Versions
107
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esmock - npm Package Compare versions

Comparing version 0.3.9 to 0.4.0

9

package.json
{
"name": "esmock",
"version": "0.3.9",
"version": "0.4.0",
"license": "MIT",

@@ -53,7 +53,6 @@ "readmeFilename": "README.md",

"ava": "^4.0.0-alpha.2",
"babel-eslint": "^10.1.0",
"eslint": "^7.17.0",
"form-urlencoded": "^4.2.1",
"eslint": "^7.32.0",
"form-urlencoded": "4.2.1",
"import-local": "3.0.2",
"sinon": "^10.0.0"
"sinon": "^11.1.2"
},

@@ -60,0 +59,0 @@ "scripts": {

@@ -54,2 +54,4 @@ esmock

* 0.4.0 _Sep.07.2021_
* do not runtime error when returuning type '[object Module]' default
* 0.3.9 _May.05.2021_

@@ -56,0 +58,0 @@ * small change to README

@@ -68,5 +68,10 @@ import fs from 'fs';

const esmockModuleImportedSanitize = importedModule => {
if ('default' in importedModule
&& !/boolean|string|number/.test(typeof importedModule.default)) {
return Object.assign(importedModule.default, importedModule);
const importedDefault = 'default' in importedModule
&& importedModule.default;
if (!/boolean|string|number/.test(typeof importedDefault)) {
// an example of [object Module]: import * as mod from 'fs'; export mod;
return Object.prototype.toString.call(importedDefault) === '[object Module]'
? Object.assign({}, importedDefault, importedModule)
: Object.assign(importedDefault, importedModule);
}

@@ -73,0 +78,0 @@

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