mirror of
https://github.com/Instadapp/Swap-Aggregator-Subgraph.git
synced 2024-07-29 21:57:12 +00:00
8 lines
437 B
JavaScript
8 lines
437 B
JavaScript
export function addCommentBefore(str, indent, comment) {
|
|
if (!comment) return str;
|
|
var cc = comment.replace(/[\s\S]^/gm, "$&".concat(indent, "#"));
|
|
return "#".concat(cc, "\n").concat(indent).concat(str);
|
|
}
|
|
export function addComment(str, indent, comment) {
|
|
return !comment ? str : comment.indexOf('\n') === -1 ? "".concat(str, " #").concat(comment) : "".concat(str, "\n") + comment.replace(/^/gm, "".concat(indent || '', "#"));
|
|
} |