MCPcopy Create free account
hub / github.com/denoland/std / #normalizeLineEndings

Method #normalizeLineEndings

xml/_tokenizer.ts:655–665  ·  view source on GitHub ↗
(chunk: string)

Source from the content-addressed store, hash-verified

653 }
654
655 #normalizeLineEndings(chunk: string): string {
656 const version = this.#xml11 ? "1.1" : "1.0";
657 const needsNormalization = this.#xml11
658 ? chunk.includes("\r") || chunk.includes("\x85") ||
659 chunk.includes("\u2028")
660 : chunk.includes("\r");
661
662 return needsNormalization
663 ? chunk.replace(LINE_ENDING_REGEXP[version], "\n")
664 : chunk;
665 }
666
667 /**
668 * Process accumulated keyword in ENTITY declaration.

Callers 1

processMethod · 0.95

Calls 1

includesMethod · 0.80

Tested by

no test coverage detected