UNPKG

@telei/explorer

Version:

A static resource server and file manager that supports GZip compression, Range segmentation, and file directory indexing.

6 lines (5 loc) 211 B
export function dedent(str) { const lines = str.replace(/^\n/, '').split('\n'); const indent = lines[0].match(/^(\s*)/)?.[0].length ?? 0; return lines.map((line) => line.slice(indent)).join('\n'); }