Skip to content

Commit

Permalink
Remove “undocument” feature of removing blank lines
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jun 25, 2022
1 parent 342df76 commit 2832244
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
* Trimmed value.
*/
export function trimLines(value) {
return String(value).replace(/[ \t]*(\r?\n|\r)+[ \t]*/g, '$1')
return String(value).replace(/[ \t]*(\r?\n|\r)[ \t]*/g, '$1')
}
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ npm install trim-lines
```js
import {trimLines} from 'trim-lines'

trimLines(' foo\t\n\n bar \n\tbaz ') // => ' foo\nbar\nbaz '
trimLines(' foo\t\n\n bar \n\tbaz ') // => ' foo\n\nbar\nbaz '
```

## API
Expand Down
2 changes: 1 addition & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test('trimLines(value)', function (t) {
t.equal(trimLines(true), 'true', 'should coerce to string')
t.equal(
trimLines(' foo\t\n\n bar \n\tbaz '),
' foo\nbar\nbaz ',
' foo\n\nbar\nbaz ',
'should work'
)
t.end()
Expand Down

0 comments on commit 2832244

Please sign in to comment.