personal_area_php/frontend/web/api-doc/docker/configurator/helpers.js
2024-05-24 15:27:07 +03:00

13 lines
271 B
JavaScript

module.exports.indent = function indent(str, len, fromLine = 0) {
return str
.split("\n")
.map((line, i) => {
if (i + 1 >= fromLine) {
return `${Array(len + 1).join(" ")}${line}`
} else {
return line
}
})
.join("\n")
}