-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e3ca5a
commit 40cd948
Showing
6 changed files
with
74 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,38 @@ | ||
declare const trimNewlines: { | ||
/** | ||
Trim from the start and end of a string. | ||
@example | ||
```js | ||
import trimNewlines from 'trim-newlines'; | ||
trimNewlines('\n🦄\r\n'); | ||
//=> '🦄' | ||
``` | ||
*/ | ||
(string: string): string; | ||
|
||
/** | ||
Trim from the start of a string. | ||
@example | ||
```js | ||
import trimNewlines from 'trim-newlines'; | ||
trimNewlines.start('\n🦄\r\n'); | ||
//=> '🦄\r\n' | ||
``` | ||
*/ | ||
start(string: string): string; | ||
|
||
/** | ||
Trim from the end of a string. | ||
@example | ||
```js | ||
import trimNewlines from 'trim-newlines'; | ||
trimNewlines.end('\n🦄\r\n'); | ||
//=> '\n🦄' | ||
``` | ||
*/ | ||
end(string: string): string; | ||
}; | ||
|
||
export default trimNewlines; | ||
/** | ||
Trim from the start and end of a string. | ||
@example | ||
```js | ||
import trimNewlines from 'trim-newlines'; | ||
trimNewlines('\n🦄\r\n'); | ||
//=> '🦄' | ||
``` | ||
*/ | ||
export function trimNewlines(string: string): string; | ||
|
||
/** | ||
Trim from the start of a string. | ||
@example | ||
```js | ||
import trimNewlines from 'trim-newlines'; | ||
trimNewlines.start('\n🦄\r\n'); | ||
//=> '🦄\r\n' | ||
``` | ||
*/ | ||
export function trimNewlinesStart(string: string): string; | ||
|
||
/** | ||
Trim from the end of a string. | ||
@example | ||
```js | ||
import trimNewlines from 'trim-newlines'; | ||
trimNewlines.end('\n🦄\r\n'); | ||
//=> '\n🦄' | ||
``` | ||
*/ | ||
export function trimNewlinesEnd(string: string): string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import {expectType} from 'tsd'; | ||
import trimNewlines from './index.js'; | ||
import {trimNewlines, trimNewlinesStart, trimNewlinesEnd} from './index.js'; | ||
|
||
expectType<string>(trimNewlines('\n🦄\r\n')); | ||
expectType<string>(trimNewlines.start('\n\n🦄\n')); | ||
expectType<string>(trimNewlines.end('\n🦄\n\n')); | ||
expectType<string>(trimNewlinesStart('\n\n🦄\n')); | ||
expectType<string>(trimNewlinesEnd('\n🦄\n\n')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters