rebase-indent

1.6.1 • Public • Published

Rebase indent

Rebase a string or an array of indented lines based on the first indentation level.

rebase([' line 1', ' line 2']) rebase([' line 1', ' line 2'], 4) rebase(' line 1\n line 2')

rebase(`
        line 1
            line 2
        line 3
            line 4
`);
line 1
    line 2
line 3
    line 4

Optionally specify a new base indent (number of spaces). Default is 0.

rebase(`
    line 1
        line 2
`, 10);
          line 1
            line 2

Dependencies (1)

Dev Dependencies (2)

Package Sidebar

Install

npm i rebase-indent

Weekly Downloads

85

Version

1.6.1

License

ISC

Unpacked Size

6.52 kB

Total Files

4

Last publish

Collaborators

  • aratramba