mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-12 11:15:14 +00:00
update shimport, minor tidy up
This commit is contained in:
@@ -2,7 +2,7 @@ import { exporter as _exporter } from '../api/export';
|
||||
import colors from 'kleur';
|
||||
import pb from 'pretty-bytes';
|
||||
import { locations } from '../config';
|
||||
import { right_pad } from '../utils';
|
||||
import { left_pad } from '../utils';
|
||||
|
||||
export function exporter(export_dir: string, {
|
||||
basepath = '',
|
||||
@@ -22,7 +22,7 @@ export function exporter(export_dir: string, {
|
||||
|
||||
emitter.on('file', event => {
|
||||
const size_color = event.size > 150000 ? colors.bold.red : event.size > 50000 ? colors.bold.yellow : colors.bold.gray;
|
||||
const size_label = size_color(right_pad(pb(event.size), 10));
|
||||
const size_label = size_color(left_pad(pb(event.size), 10));
|
||||
|
||||
const file_label = event.status === 200
|
||||
? event.file
|
||||
|
||||
@@ -2,9 +2,8 @@ import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import colors from 'kleur';
|
||||
import pb from 'pretty-bytes';
|
||||
import { locations } from '../config';
|
||||
import relative from 'require-relative';
|
||||
import { left_pad, right_pad } from '../utils';
|
||||
import { left_pad } from '../utils';
|
||||
|
||||
let r: any;
|
||||
let wp: any;
|
||||
|
||||
@@ -3,11 +3,6 @@ export function left_pad(str: string, len: number) {
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user