Socket
Socket
Sign inDemoInstall

@chialab/cjs-to-esm

Package Overview
Dependencies
3
Maintainers
2
Versions
78
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.17.7 to 0.17.8

24

lib/index.js

@@ -265,3 +265,19 @@ import { TokenType, parse, walk, getBlock, getStatement, parseCommonjs, parseEsm, createEmptySourcemapComment } from '@chialab/estransform';

helpers.prepend(`var __umdGlobal = ${GLOBAL_HELPER};
var __umdRoot = Object.create(__umdGlobal);
var __umdExports = [];
var __umdRoot = new Proxy(__umdGlobal, {
get: function(target, name) {
var value = Reflect.get(target, name);
if (__umdExports.indexOf(name) !== -1) {
return value;
}
if (typeof value === 'function') {
return value.bind(__umdGlobal);
}
return value;
},
set: function(target, name, value) {
__umdExports.push(name);
return Reflect.set(target, name, value);
},
});
var __umdFunction = function(code) {

@@ -275,8 +291,4 @@ return __umdGlobal.Function(code).bind(__umdRoot);

Object.assign(__umdGlobal, __umdRoot);
export default (__umdExports.length !== 1 && __umdRoot[__umdExports[0]] !== __umdRoot[__umdExports[1]] ? __umdRoot : __umdRoot[__umdExports[0]]);`);
var keys = Object.keys(__umdRoot);
export default (keys.length !== 1 && __umdRoot[keys[0]] !== __umdRoot[keys[1]] ? __umdRoot : __umdRoot[keys[0]]);`);
// replace the usage of `this` as global object because is not supported in esm

@@ -283,0 +295,0 @@ let thisMatch = THIS_PARAM.exec(code);

{
"name": "@chialab/cjs-to-esm",
"type": "module",
"version": "0.17.7",
"version": "0.17.8",
"description": "A commonjs to esm converter.",

@@ -6,0 +6,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc