Socket
Socket
Sign inDemoInstall

es6-module-crosspiler

Package Overview
Dependencies
4
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

17

lib/common.js

@@ -29,2 +29,19 @@

// look for module.exports or exports.xxxx
memo(Module.prototype, 'hasCommonExports', function () {
var hasCommonExports = false
types.visit(this.ast.program, {
visitIdentifier: function (path) {
var id = path.value.name
if (id === 'module' && !path.scope.lookup('module')
|| id === 'exports' && !path.scope.lookup('exports')) {
hasCommonExports = true
return false
}
this.traverse(path)
}
})
return hasCommonExports
})
function skipFunctionTraversal(path) {

@@ -31,0 +48,0 @@ // `require` is defined somewhere

1

lib/exports.js

@@ -64,2 +64,3 @@

/* istanbul ignore next */
assert(false, 'an error occured. you are probably using a bad version of esprima')

@@ -66,0 +67,0 @@ }, this)

@@ -81,3 +81,6 @@

memo(Module.prototype, 'type', function () {
return this.isModule() ? 'module' : 'commonjs'
if (this.isModule()) return 'module'
if (this.requires.length) return 'commonjs'
if (this.hasCommonExports) return 'commonjs'
return null
})

@@ -93,2 +96,3 @@

Module.prototype.exportsDefault = function () {
if (this.type !== 'module') return false
return this.exports.filter(hasDefault).length === 1

@@ -95,0 +99,0 @@ }

2

package.json
{
"name": "es6-module-crosspiler",
"description": "An ES6 and CommonJS cross-compatible transpiler",
"version": "1.0.0",
"version": "1.0.1",
"author": {

@@ -6,0 +6,0 @@ "name": "Jonathan Ong",

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc