format
import { format } from "jsr:@ende/fs";function
function format(content: string, eol: typeof EOL): stringNormalize the input string to the targeted EOL.
content: stringThe input string to normalize.
eol: typeof EOLThe EOL character(s) to normalize the input string to.
Returns
The input string normalized to the targeted EOL.
Example: Usage
import { LF, format } from "@ende/fs/eol";
import { assertEquals } from "@ende/assert";
const CRLFinput = "deno\r\nis not\r\nnode";
assertEquals(format(CRLFinput, LF), "deno\nis not\nnode");