Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify return values in docs #12

Merged
merged 2 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Loading