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

Method #normalizeLineEndings

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

Source from the content-addressed store, hash-verified

604 }
605
606 #normalizeLineEndings(chunk: string): string {
607 const version = this.#xml11 ? "1.1" : "1.0";
608 const needsNormalization = this.#xml11
609 ? chunk.includes("\r") || chunk.includes("\x85") ||
610 chunk.includes("\u2028")
611 : chunk.includes("\r");
612
613 return needsNormalization
614 ? chunk.replace(LINE_ENDING_REGEXP[version], "\n")
615 : chunk;
616 }
617
618 /**
619 * Process accumulated keyword in ENTITY declaration.

Callers 1

processMethod · 0.95

Calls 1

includesMethod · 0.80

Tested by

no test coverage detected