New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@binaris/shift-babel-macro

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@binaris/shift-babel-macro - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

dist/macro.d.ts

17

CHANGELOG.json

@@ -5,2 +5,19 @@ {

{
"version": "0.0.4",
"tag": "@binaris/shift-babel-macro_v0.0.4",
"date": "Thu, 18 Jul 2019 12:48:13 GMT",
"comments": {
"patch": [
{
"comment": "Use common module for some babel code"
}
],
"dependency": [
{
"comment": "Updating dependency \"@binaris/shift-babel-common\" from `0.0.0` to `0.0.1`"
}
]
}
},
{
"version": "0.0.3",

@@ -7,0 +24,0 @@ "tag": "@binaris/shift-babel-macro_v0.0.3",

9

CHANGELOG.md
# Change Log - @binaris/shift-babel-macro
This log was last generated on Tue, 09 Jul 2019 07:26:14 GMT and should not be manually modified.
This log was last generated on Thu, 18 Jul 2019 12:48:13 GMT and should not be manually modified.
## 0.0.4
Thu, 18 Jul 2019 12:48:13 GMT
### Patches
- Use common module for some babel code
## 0.0.3

@@ -6,0 +13,0 @@ Tue, 09 Jul 2019 07:26:14 GMT

22

dist/macro.js

@@ -8,7 +8,5 @@ "use strict";

const parser_1 = require("@babel/parser");
const shift_babel_common_1 = require("@binaris/shift-babel-common");
const fs_1 = require("fs");
const path_1 = __importDefault(require("path"));
function getFunctionName(e, t) {
return t.isIdentifier(e.id) ? e.id.name : undefined;
}
function assertExportedMember(ast, t, funcName) {

@@ -19,12 +17,3 @@ // This function is looking for this line in the file

const { body } = ast.program;
const isFunctionExported = body.some((e) => t.isExpressionStatement(e) &&
t.isAssignmentExpression(e.expression) &&
e.expression.operator === '=' &&
t.isMemberExpression(e.expression.left) &&
t.isIdentifier(e.expression.left.object) &&
e.expression.left.object.name === 'exports' &&
t.isIdentifier(e.expression.left.property) &&
e.expression.left.property.name === funcName &&
t.isIdentifier(e.expression.right) &&
e.expression.right.name === funcName);
const isFunctionExported = body.some((e) => shift_babel_common_1.isTypeScriptGeneratedExport(e, t, funcName));
if (!isFunctionExported) {

@@ -37,6 +26,6 @@ throw new Error(`${funcName} has @expose decorator but it is not exported`);

// support ExportDefaultDeclaration (ExportAllDeclaration too for re-exporting ?)
const exposedStatements = body.filter((e) => e.leadingComments && e.leadingComments.some((comment) => /@expose/.test(comment.value)));
const exposedStatements = body.filter(shift_babel_common_1.isExposedStatement);
return exposedStatements.reduce((ret, e) => {
if (t.isFunctionDeclaration(e)) {
const funcName = getFunctionName(e, t);
const funcName = shift_babel_common_1.getFunctionName(e, t);
if (funcName && importedNames.includes(funcName)) {

@@ -48,3 +37,3 @@ assertExportedMember(ast, t, funcName);

else if (t.isExportNamedDeclaration(e) && t.isFunctionDeclaration(e.declaration)) {
const funcName = getFunctionName(e.declaration, t);
const funcName = shift_babel_common_1.getFunctionName(e.declaration, t);
if (funcName) {

@@ -129,1 +118,2 @@ ret.push(funcName);

module.exports = babel_plugin_macros_1.createMacro(shiftMacro);
//# sourceMappingURL=macro.js.map

@@ -14,1 +14,2 @@ "use strict";

exports.bar = bar;
//# sourceMappingURL=mockTypeScriptBackend.js.map

@@ -117,1 +117,2 @@ "use strict";

});
//# sourceMappingURL=macro.spec.js.map
{
"name": "@binaris/shift-babel-macro",
"version": "0.0.3",
"version": "0.0.4",
"files": [

@@ -17,7 +17,8 @@ "dist",

"dependencies": {
"@babel/parser": "^7.4.5",
"babel-plugin-macros": "^2.6.0"
"@babel/parser": "^7.5.0",
"@binaris/shift-babel-common": "0.0.1",
"babel-plugin-macros": "^2.6.1"
},
"devDependencies": {
"@babel/types": "^7.4.4",
"@babel/types": "^7.5.0",
"@types/jest": "^24.0.15",

@@ -29,4 +30,4 @@ "@types/node": "^10.14.9",

"tslint": "^5.18.0",
"typescript": "^3.5.2"
"typescript": "^3.5.3"
}
}
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