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

babel-plugin-transform-move-comments-to-top

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-move-comments-to-top - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

27

lib/index.js

@@ -18,4 +18,15 @@ 'use strict';

if (path.node.leadingComments) {
comments = comments.concat(path.node.leadingComments);
path.node.leadingComments.forEach(function (comment) {
if (!deepIncludes(comments, comment)) {
comments = comments.concat(comment);
}
});
}
if (path.node.trailingComments) {
path.node.trailingComments.forEach(function (comment) {
if (!deepIncludes(comments, comment)) {
comments = comments.concat(comment);
}
});
}
t.removeComments(path.node);

@@ -37,2 +48,14 @@ }

};
};
};
var _deepEqual = require('deep-equal');
var _deepEqual2 = _interopRequireDefault(_deepEqual);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function deepIncludes(arr, value) {
return arr.some(function (item) {
return (0, _deepEqual2.default)(item, value);
});
}
{
"name": "babel-plugin-transform-move-comments-to-top",
"version": "1.0.2",
"version": "1.0.3",
"description": "Move comments to top of the file",

@@ -22,2 +22,3 @@ "repository": "https://github.com/chentsulin/babel-plugin-transform-move-comments-to-top",

"mocha": "^2.5.3",
"nyc": "^6.6.1",
"rimraf": "^2.5.2"

@@ -30,4 +31,14 @@ },

"test": "mocha --compilers js:babel-register",
"test:cov": "nyc npm test",
"preversion": "npm test"
},
"nyc": {
"reporter": [
"lcov",
"text"
]
},
"dependencies": {
"deep-equal": "^1.0.1"
}
}
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