* Returns new prefix string. * @param {string | string[]} s string to create prefix for * @param {string} prefix prefix to compose * @returns {string} returns new prefix string
(s, prefix)
| 250 | * @returns {string} returns new prefix string |
| 251 | */ |
| 252 | static prefix(s, prefix) { |
| 253 | const str = Template.asString(s).trim(); |
| 254 | if (!str) return ""; |
| 255 | const ind = str[0] === "\n" ? "" : prefix; |
| 256 | return ind + str.replace(/\n([^\n])/g, `\n${prefix}$1`); |
| 257 | } |
| 258 | |
| 259 | /** |
| 260 | * Returns a single string from array. |