Skip to contentOpen History to see the last commit
test-utils.ts
5 lines257 Bytes
1export function normalizeIndent(template: TemplateStringsArray) { 2 const codeLines = template[0]?.split('\n') ?? [''] 3 const leftPadding = codeLines[1]?.match(/\s+/)?.[0] ?? '' 4 return codeLines.map((line) => line.slice(leftPadding.length)).join('\n')