print nice build summaries

This commit is contained in:
Rich Harris
2018-08-29 15:03:10 -04:00
parent 458be49b35
commit 6393a30b13
5 changed files with 98 additions and 16 deletions

15
src/utils.ts Normal file
View File

@@ -0,0 +1,15 @@
export function left_pad(str: string, len: number) {
while (str.length < len) str = ` ${str}`;
return str;
}
export function right_pad(str: string, len: number) {
while (str.length < len) str += ' ';
return str;
}
export function repeat(str: string, i: number) {
let result = '';
while (i--) result += str;
return result;
}