MCPcopy
hub / github.com/angular/angular-cli / getEOL

Function getEOL

packages/schematics/angular/utility/eol.ts:14–25  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

12const LF = '\n';
13
14export function getEOL(content: string): string {
15 const newlines = content.match(/(?:\r?\n)/g);
16
17 if (newlines?.length) {
18 const crlf = newlines.filter((l) => l === CRLF).length;
19 const lf = newlines.length - crlf;
20
21 return crlf > lf ? CRLF : LF;
22 }
23
24 return EOL;
25}

Callers 2

insertImportFunction · 0.90
constructorMethod · 0.90

Calls 1

matchMethod · 0.45

Tested by

no test coverage detected