1.0.0 • Published 11 years ago
mltl v1.0.0
Strip the newlines and indentations out of a multi-line template literal:
function foo() {
return `
one
two
three
`
}compiles to
function foo() {
return "\n one\n two\n three\n ";
}so use mltl:
function foo() {
return mltl(`
one
two
three
`)
}
console.log(foo()) == // one\ntwo\nthreemltl(str: string, removeNewLines: boolean): string
stris the template literal string to strip from indent whitespaceremoveNewLinesis an option if new lines should be substituted by spaces or left alone
1.0.0
11 years ago