Dashboard sipadu mbip
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

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. }