MCPcopy Create free account
hub / github.com/zxlie/FeHelper / normalizeLineEndings

Function normalizeLineEndings

apps/json-diff/diff-utils.js:1–3  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

1function normalizeLineEndings(text) {
2 return String(text || '').replace(/\r\n/g, '\n').replace(/\r/g, '\n');
3}
4
5export function splitLines(text) {
6 return normalizeLineEndings(text).split('\n');

Callers 1

splitLinesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected