* add `onFound` callback to schemas * add warning to method docs (for #4957) * implement Docker OAuth2 init block support * update docs * add OAUTH_SCOPE_SEPARATOR * drop OAuth env from Dockerfile and run script * don't indent the first oauth block line * drop unused `dedent` import * touch up warning message * add more test cases * return an empty block if no OAuth content is generated * fix broken doc line
13 lines
271 B
JavaScript
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")
|
|
} |