tamino-martinius / node-ts-dedent

TypeScript package which smartly trims and strips indentation from multi-line strings
MIT License
159 stars 8 forks source link

Could you please explain exactly what it does in the docs? #39

Open toddobryan opened 8 months ago

toddobryan commented 8 months ago

Based on the examples, I think it removes a starting bare newline, and then removes the number of whitespace characters on the first line that starts with whitespace characters. Or does it remove the number of whitespace characters on the line with the fewest leading whitespace characters?

A quick summary of what the algorithm is would make it easier than having to look in the code or try stuff.