diff --git a/index.d.ts b/index.d.ts index 20cb682..05d40ab 100644 --- a/index.d.ts +++ b/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 ``` @@ -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 ``` diff --git a/readme.md b/readme.md index 1103ee4..30ec068 100644 --- a/readme.md +++ b/readme.md @@ -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