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

jsdc

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsdc - npm Package Compare versions

Comparing version 0.4.4 to 0.4.5

2

package.json
{
"name": "jsdc",
"version": "0.4.4",
"version": "0.4.5",
"description": "compiler ecmascript6 to ecmascript5",

@@ -5,0 +5,0 @@ "maintainers": [

@@ -529,8 +529,10 @@ Javascript Downcast

```
`export default`会直接赋给`module.exports`:
`export default`会赋给`exports.default`,这样在使用时会判断是否有`default`属性:
```js
export default a
import b from "a"
```
```js
module.exports=a
var b=function(){var _0_=require("a");return _0_.hasOwnProperty("default")?_0_.default:_0_}()}()
```

@@ -537,0 +539,0 @@

@@ -40,6 +40,11 @@ var homunculus = require('homunculus');

}
self.jsdc.append('var ' + id);
var temp = self.jsdc.uid();
self.jsdc.append('var ' + id + '=');
self.jsdc.append('function(){var ' + temp);
self.jsdc.append('=require(');
self.jsdc.append(last.last().token().content());
self.jsdc.append(');');
self.jsdc.append(');return ');
self.jsdc.append(temp + '.hasOwnProperty("default")?');
self.jsdc.append(temp + '.default:' + temp);
self.jsdc.append('}()');
}

@@ -46,0 +51,0 @@ //import ids from "string",import {ids} from "string"

@@ -41,6 +41,11 @@ define(function(require, exports, module) {

}
self.jsdc.append('var ' + id);
var temp = self.jsdc.uid();
self.jsdc.append('var ' + id + '=');
self.jsdc.append('function(){var ' + temp);
self.jsdc.append('=require(');
self.jsdc.append(last.last().token().content());
self.jsdc.append(');');
self.jsdc.append(');return ');
self.jsdc.append(temp + '.hasOwnProperty("default")?');
self.jsdc.append(temp + '.default:' + temp);
self.jsdc.append('}()');
}

@@ -47,0 +52,0 @@ //import ids from "string",import {ids} from "string"

Sorry, the diff of this file is not supported yet

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