From 56c1f2a6d7094510e5f888c194f2bc672ee7b73d Mon Sep 17 00:00:00 2001 From: Levi Buzolic Date: Thu, 11 Jul 2024 13:01:15 +1000 Subject: [PATCH] Fix TS --- src/cli-parameters.ts | 12 ++++++------ tsconfig.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/cli-parameters.ts b/src/cli-parameters.ts index a2b0819..fffd2e1 100644 --- a/src/cli-parameters.ts +++ b/src/cli-parameters.ts @@ -42,18 +42,18 @@ function getPlatform(parsed: minimist.ParsedArgs) { * * @param argv The parameters to use (default: reads from `process.argv`) */ -export function parse(argv?: string[]): CliParameters { +export function parse( // use the default process args if nothing was passed in - argv = argv || process.argv.slice(2); - + argv: string[] = process.argv.slice(2) +): CliParameters { // parse the arguments with minimist const parsed = minimist(argv); // grab what we need const platform = getPlatform(parsed); - const useClipboard = !parsed['f']; - const filename = (parsed['f'] as string) || tempfile('.png'); - const device = parsed['d'] as string; + const useClipboard = !parsed.f; + const filename = (parsed.f as string) || tempfile({ extension: 'png' }); + const device = parsed.d as string; return { platform, filename, device, useClipboard }; } diff --git a/tsconfig.json b/tsconfig.json index f8eb70e..067b103 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "module": "commonjs", + "module": "Node16", "moduleResolution": "node16", "declaration": true, "noImplicitAny": false,