A world-class math input for the web
at main 9 lines 264 B view raw
1export function indent(str: string, indentation: string | number = 4): string { 2 const indentStr = 3 typeof indentation === "number" ? " ".repeat(indentation) : indentation; 4 5 return str 6 .split("\n") 7 .map((line) => indentStr + line) 8 .join("\n"); 9}