Sha256: f983073f72878830f7265538c9d372bd330a0360dc328643ad949473d5f1f2d6

Contents?: true

Size: 514 Bytes

Versions: 24

Compression:

Stored size: 514 Bytes

Contents

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.addCommentBefore = addCommentBefore;
exports.default = addComment;

function addCommentBefore(str, indent, comment) {
  if (!comment) return str;
  const cc = comment.replace(/[\s\S]^/gm, `$&${indent}#`);
  return `#${cc}\n${indent}${str}`;
}

function addComment(str, indent, comment) {
  return !comment ? str : comment.indexOf('\n') === -1 ? `${str} #${comment}` : `${str}\n` + comment.replace(/^/gm, `${indent || ''}#`);
}

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
trusty-cms-5.0.7 node_modules/yaml/dist/addComment.js
trusty-cms-5.0.6 node_modules/yaml/dist/addComment.js
trusty-cms-5.0.5 node_modules/yaml/dist/addComment.js
trusty-cms-5.0.4 node_modules/yaml/dist/addComment.js
trusty-cms-5.0.3 node_modules/yaml/dist/addComment.js
trusty-cms-5.0.2 node_modules/yaml/dist/addComment.js
trusty-cms-5.0.1 node_modules/yaml/dist/addComment.js
trusty-cms-4.3.5 node_modules/yaml/dist/addComment.js
trusty-cms-5.0.0 node_modules/yaml/dist/addComment.js
trusty-cms-4.3.4 node_modules/yaml/dist/addComment.js
trusty-cms-4.3.3 node_modules/yaml/dist/addComment.js
trusty-cms-4.3.2 node_modules/yaml/dist/addComment.js
trusty-cms-4.3.1 node_modules/yaml/dist/addComment.js
trusty-cms-4.3 node_modules/yaml/dist/addComment.js
trusty-cms-4.2.3 node_modules/yaml/dist/addComment.js
trusty-cms-4.2.2 node_modules/yaml/dist/addComment.js
trusty-cms-4.2.1 node_modules/yaml/dist/addComment.js
trusty-cms-4.2 node_modules/yaml/dist/addComment.js
trusty-cms-4.1.9 node_modules/yaml/dist/addComment.js
trusty-cms-4.1.8 node_modules/yaml/dist/addComment.js