MCPcopy Index your code
hub / github.com/kpdecker/jsdiff / hasOnlyWinLineEndings

Function hasOnlyWinLineEndings

src/util/string.ts:94–96  ·  view source on GitHub ↗
(string: string)

Source from the content-addressed store, hash-verified

92 * Returns true if the string consistently uses Windows line endings.
93 */
94export function hasOnlyWinLineEndings(string: string): boolean {
95 return string.includes('\r\n') && !string.startsWith('\n') && !string.match(/[^\r]\n/);
96}
97
98/**
99 * Returns true if the string consistently uses Unix line endings.

Callers 1

applyStructuredPatchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected