Skip to content
This repository was archived by the owner on May 22, 2024. It is now read-only.

Commit 2b8571b

Browse files
committed
style: fix tests
1 parent 4900d3e commit 2b8571b

File tree

4 files changed

+35
-34
lines changed

4 files changed

+35
-34
lines changed

src/Constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ export const SUPPORTED_EXTENSIONS = [
2121
];
2222

2323
/** Used to wrap/centre content in the terminal */
24-
export const WRAP_WIDTH = 40;
24+
export const WRAP_WIDTH = 40;

src/Main.ts

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import boxen from 'boxen';
2-
import chalk from 'chalk';
1+
import boxen from "boxen";
2+
import chalk from "chalk";
33

4-
import { IConfig } from './Config';
5-
import { WRAP_WIDTH } from './Constants';
6-
import { Controller } from './Controller';
7-
import { IResult, PreparationError } from './Interfaces';
8-
import { Logger } from './Logger';
9-
import { IFile, Preparation } from './Preparation';
10-
import { centreText } from './Utility';
4+
import { IConfig } from "./Config";
5+
import { WRAP_WIDTH } from "./Constants";
6+
import { Controller } from "./Controller";
7+
import { IResult, PreparationError } from "./Interfaces";
8+
import { Logger } from "./Logger";
9+
import { IFile, Preparation } from "./Preparation";
10+
import { centreText } from "./Utility";
1111

1212
export async function main(config: IConfig): Promise<IResult> {
1313
const logger = new Logger(config.verbosity);
@@ -60,25 +60,26 @@ export async function main(config: IConfig): Promise<IResult> {
6060
padding: { top: 0, left: 2, right: 2, bottom: 0 },
6161
borderColor: "redBright"
6262
}) + "\n",
63-
WRAP_WIDTH),
63+
WRAP_WIDTH
64+
),
6465
Logger.VERBOSE
6566
);
6667
throw err;
6768
}
6869
}
6970

7071
function showBanner(logger: Logger) {
71-
logger.log(chalk.bold.white(`
72+
logger.log(
73+
chalk.bold.white(`
7274
______ _____ _______
7375
(, / ) (, / (, / )
7476
/__ / / /---(
7577
) / \\____/__ ) / ____)
76-
(_/ (__ / (_/ (`), 10);
78+
(_/ (__ / (_/ (`),
79+
10
80+
);
7781
logger.log(
78-
centreText(
79-
"\n\n A WebP build pipeline\n https://git.io/fjvL7\n",
80-
WRAP_WIDTH
81-
),
82+
centreText("\n\n A WebP build pipeline\n https://git.io/fjvL7\n", WRAP_WIDTH),
8283
Logger.VERBOSE
8384
);
8485
}

src/Preparation.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import chalk from 'chalk';
2-
import { DynamicTerminal, ILine } from 'dynamic-terminal';
3-
import { prompt } from 'enquirer';
4-
import figures from 'figures';
5-
import fs from 'fs-extra';
6-
import os from 'os';
7-
import path from 'path';
8-
import slash from 'slash';
9-
import glob from 'tiny-glob';
10-
11-
import { IConfig } from './Config';
12-
import { SUPPORTED_EXTENSIONS, WRAP_WIDTH } from './Constants';
13-
import { PreparationError } from './Interfaces';
14-
import { Logger } from './Logger';
15-
import { centreText } from './Utility';
1+
import chalk from "chalk";
2+
import { DynamicTerminal, ILine } from "dynamic-terminal";
3+
import { prompt } from "enquirer";
4+
import figures from "figures";
5+
import fs from "fs-extra";
6+
import os from "os";
7+
import path from "path";
8+
import slash from "slash";
9+
import glob from "tiny-glob";
10+
11+
import { IConfig } from "./Config";
12+
import { SUPPORTED_EXTENSIONS, WRAP_WIDTH } from "./Constants";
13+
import { PreparationError } from "./Interfaces";
14+
import { Logger } from "./Logger";
15+
import { centreText } from "./Utility";
1616

1717
export interface IFile {
1818
base: string;

src/Utility.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import sharp, { Sharp } from "sharp";
21
import ansiAlign from "ansi-align";
2+
import sharp, { Sharp } from "sharp";
33
import wrapAnsi from "wrap-ansi";
44

55
export function isSharpInstance(instance: object): instance is Sharp {
@@ -10,4 +10,4 @@ export function isSharpInstance(instance: object): instance is Sharp {
1010
export function centreText(text: string, width: number): string {
1111
const wrappedLine: string = ansiAlign.center(wrapAnsi(text, width) + "\n" + " ".repeat(width));
1212
return wrappedLine.substring(0, wrappedLine.lastIndexOf("\n"));
13-
}
13+
}

0 commit comments

Comments
 (0)