Comparing version 1.0.2 to 1.0.3
@@ -16,3 +16,3 @@ 'use strict'; | ||
function Style(body, start, end) { | ||
this.body = body +' '; | ||
this.body = body; | ||
this.end = end || body; | ||
@@ -81,3 +81,3 @@ this.start = start || body; | ||
Array.prototype.push.apply(comment, text.map(function each(line) { | ||
return style.body + line.trim(); | ||
return style.body + (line ? ' ' + line.trim() : ''); | ||
})); | ||
@@ -84,0 +84,0 @@ |
{ | ||
"name": "commenting", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Wrap content in a comment that is valid for a given file type.", | ||
@@ -29,3 +29,3 @@ "main": "index.js", | ||
"devDependencies": { | ||
"assume": "1.2.x", | ||
"assume": "1.4.x", | ||
"istanbul": "0.3.x", | ||
@@ -32,0 +32,0 @@ "mocha": "2.2.x", |
12
test.js
@@ -32,2 +32,14 @@ describe('commenting', function () { | ||
it('keep empty lines', function () { | ||
var comment = commenting(['hello', '', 'world'], { | ||
extension: '.js' | ||
}); | ||
assume(comment).includes('/**\n'); | ||
assume(comment).includes(' * hello\n'); | ||
assume(comment).includes(' *\n'); | ||
assume(comment).includes(' * world\n'); | ||
assume(comment).includes(' */\n'); | ||
}); | ||
it('uses the supplied style', function () { | ||
@@ -34,0 +46,0 @@ var comment = commenting('hello ', { |
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
7254
146