Today I Learned TypeScript Dedent
Landon Schropp •
Today I learned about TypeScript Dedent, a nifty little TypeScript package that’ll let you nicely indent multiline template strings. For example, this:
console.log(dedent`
Leading and trailing lines will be trimmed, so you can
write something like this and have it work as you'd
expect:
* How convenient it is...
* ...that I can use an indented list...
- ...and still have it do the right thing.
That's all.
`);
Outputs this:
Leading and trailing lines will be trimmed, so you can
write something like this and have it work as you
expect:
* How convenient it is...
* ...that I can use an indented list...
- ...and still have it do the right thing.
That's all.