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-4.1.7 node_modules/yaml/dist/addComment.js
trusty-cms-4.1.6 node_modules/yaml/dist/addComment.js
trusty-cms-4.1.5 node_modules/yaml/dist/addComment.js
enju_library-0.3.8 spec/dummy/node_modules/yaml/dist/addComment.js