Skip to content

Commit

Permalink
refactor(format): combines two maps into one
Browse files Browse the repository at this point in the history
which is good for readability (and arguably a bit for performance, even though at the scale of the inputs it won't be perceptible to really matter)
  • Loading branch information
sverweij committed Oct 3, 2024
1 parent e0b5b5c commit 0f61590
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
5 changes: 1 addition & 4 deletions dist/format/format.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export async function cli(
pOutStream: Writable = process.stdout,
pErrorStream: Writable = process.stderr,
pErrorExitCode: number = 1,
) {
): Promise<void> {
try {
const lArguments = getArguments(pArguments);

Expand Down
5 changes: 1 addition & 4 deletions src/format/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ export function format(
pExtensions: string,
): string {
const lExtensions: Set<string> = new Set(
pExtensions
.split(",")
.map((pExtension) => pExtension.trim())
.map((pExtension) => `.${pExtension}`),
pExtensions.split(",").map((pExtension) => `.${pExtension.trim()}`),
);
// @ts-expect-error ts(2722) - Object is possibly 'undefined' - that's not
// possible // because the OUTPUT_TYPE_TO_FUNCTION map contains all possible
Expand Down

0 comments on commit 0f61590

Please sign in to comment.