Dashboard sipadu mbip
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

addComment.js 580B

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. var cc = comment.replace(/[\s\S]^/gm, "$&".concat(indent, "#"));
  10. return "#".concat(cc, "\n").concat(indent).concat(str);
  11. }
  12. function addComment(str, indent, comment) {
  13. return !comment ? str : comment.indexOf('\n') === -1 ? "".concat(str, " #").concat(comment) : "".concat(str, "\n") + comment.replace(/^/gm, "".concat(indent || '', "#"));
  14. }