Skip to content

Commit

Permalink
Clarify return values in docs (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
silverwind committed Sep 22, 2023
1 parent 36e1f24 commit 4a4cf94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions index.d.ts
@@ -1,7 +1,7 @@
/**
Detect the dominant newline character of a string.
@returns The detected newline or `undefined` when no newline character is found.
@returns The detected newline or `undefined` when no newline character is found or `\n` when no dominant newline is present.
@example
```
Expand All @@ -16,7 +16,7 @@ export function detectNewline(string: string): '\r\n' | '\n' | undefined;
/**
Detect the dominant newline character of a string.
@returns The detected newline or `\n` when no newline character is found or the input is not a string.
@returns The detected newline or `\n` when no newline character is found, no dominant newline is present, or the input is not a string.
@example
```
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Expand Up @@ -21,11 +21,11 @@ detectNewline('foo\nbar\nbaz\r\n');

### detectNewline(string)

Returns the detected newline or `undefined` when no newline character is found.
Returns the detected newline or `undefined` when no newline character is found or `\n` when no dominant newline is present.

### detectNewlineGraceful(unknown)

Returns the detected newline or `\n` when no newline character is found or the input is not a string.
Returns the detected newline or `\n` when no newline character is found, no dominant newline is present, or the input is not a string.

## Related

Expand Down

0 comments on commit 4a4cf94

Please sign in to comment.