Skip to content

Commit

Permalink
docs(get-line-ending): added func description
Browse files Browse the repository at this point in the history
  • Loading branch information
YuryShkoda committed Jul 20, 2023
1 parent ec656b5 commit 66b11b1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/file/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,10 @@ export const testFileRegExp = /\.test\.(\d+\.)?sas$/i

export const isTestFile = (fileName: string) => testFileRegExp.test(fileName)

/**
* Returns end of line sequence
* @param content to get end of line sequence.
* @returns CRLF(\r\n) or LF(\n) end of line sequence
*/
export const getLineEnding = (content: string) =>
new RegExp(LineEndings.CRLF).test(content) ? LineEndings.CRLF : LineEndings.LF

0 comments on commit 66b11b1

Please sign in to comment.