babel-plugin-transform-move-comments-to-top
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -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" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3683
51
1
7
+ Addeddeep-equal@^1.0.1
+ Addedcall-bind@1.0.8(transitive)
+ Addedcall-bind-apply-helpers@1.0.1(transitive)
+ Addedcall-bound@1.0.3(transitive)
+ Addeddeep-equal@1.1.2(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddefine-properties@1.2.1(transitive)
+ Addeddunder-proto@1.0.1(transitive)
+ Addedes-define-property@1.0.1(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes-object-atoms@1.0.0(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedfunctions-have-names@1.2.3(transitive)
+ Addedget-intrinsic@1.2.6(transitive)
+ Addedgopd@1.2.0(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-symbols@1.1.0(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedis-arguments@1.2.0(transitive)
+ Addedis-date-object@1.1.0(transitive)
+ Addedis-regex@1.2.1(transitive)
+ Addedmath-intrinsics@1.1.0(transitive)
+ Addedobject-is@1.1.6(transitive)
+ Addedobject-keys@1.1.1(transitive)
+ Addedregexp.prototype.flags@1.5.3(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedset-function-name@2.0.2(transitive)