Dashboard sipadu mbip
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

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