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

commenting

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

commenting - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

4

index.js

@@ -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",

@@ -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 ', {

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