(str, prefix, noPrefixInFirstLine)
| 1269 | * @returns {string} result |
| 1270 | */ |
| 1271 | const indent = (str, prefix, noPrefixInFirstLine) => { |
| 1272 | const rem = str.replace(/\n([^\n])/g, `\n${prefix}$1`); |
| 1273 | if (noPrefixInFirstLine) return rem; |
| 1274 | const ind = str[0] === "\n" ? "" : prefix; |
| 1275 | return ind + rem; |
| 1276 | }; |
| 1277 | |
| 1278 | /** |
| 1279 | * Join explicit new line. |
no test coverage detected