Dashboard sipadu mbip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

addComment.js 514B

1234567891011121314151617
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.addCommentBefore = addCommentBefore;
  6. exports.default = addComment;
  7. function addCommentBefore(str, indent, comment) {
  8. if (!comment) return str;
  9. const cc = comment.replace(/[\s\S]^/gm, `$&${indent}#`);
  10. return `#${cc}\n${indent}${str}`;
  11. }
  12. function addComment(str, indent, comment) {
  13. return !comment ? str : comment.indexOf('\n') === -1 ? `${str} #${comment}` : `${str}\n` + comment.replace(/^/gm, `${indent || ''}#`);
  14. }