UNPKG

388 BTypeScriptView Raw
1/**
2Strip leading whitespace from each line in a string.
3
4The line with the least number of leading whitespace, ignoring empty lines, determines the number to remove.
5
6@example
7```
8import stripIndent from 'strip-indent';
9
10const string = '\tunicorn\n\t\tcake';
11// unicorn
12// cake
13
14stripIndent(string);
15//unicorn
16// cake
17```
18*/
19export default function stripIndent(string: string): string;