From 8cd91cefdc86de43cffb10703b014596e9bf7336 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Fri, 20 Oct 2023 08:20:25 +0000 Subject: [PATCH] style: format code with dotnet-format, Prettier and StandardJS This commit fixes the style issues introduced in c9d9a01 according to the output from dotnet-format, Prettier and StandardJS. Details: None --- Scripts/ts/delete-github-package-version.ts | 23 ++++-- Scripts/ts/github-cli-types.ts | 83 +++++++++++---------- 2 files changed, 60 insertions(+), 46 deletions(-) diff --git a/Scripts/ts/delete-github-package-version.ts b/Scripts/ts/delete-github-package-version.ts index 3580773837d..dab2c5f1ae6 100755 --- a/Scripts/ts/delete-github-package-version.ts +++ b/Scripts/ts/delete-github-package-version.ts @@ -10,17 +10,17 @@ * License: MIT (https://opensource.org/licenses/MIT) */ -import process from 'process'; +import process from "process"; import { deletePackageVersionAsync } from "./github-cli.js"; -import { PackageType, toPackageType, toSemVer } from './github-cli-types.js'; -import yargs from 'yargs/yargs'; -import { hideBin } from 'yargs/helpers'; +import { PackageType, toPackageType, toSemVer } from "./github-cli-types.js"; +import yargs from "yargs/yargs"; +import { hideBin } from "yargs/helpers"; import { SemVer } from "semver"; // const argv = yargs(hideBin(process.argv)); const getArg = function (...marker: string[]): string | undefined { for (let i = 0; i < marker.length; i++) { - var pos = process.argv.findIndex(arg => arg.endsWith(marker[i])); + var pos = process.argv.findIndex((arg) => arg.endsWith(marker[i])); if (pos > -1 && pos < process.argv.length - 1) { return process.argv[pos + 1]; } @@ -29,7 +29,6 @@ const getArg = function (...marker: string[]): string | undefined { }; const main = async () => { - // console.log(`yargs: ${JSON.stringify(yargs)}`); // console.log(`argv: ${JSON.stringify(argv)}`); @@ -62,7 +61,9 @@ const main = async () => { const packageType = toPackageType(getArg("t", "type", "package-type")); const token = getArg("token", "k"); - console.log(`Args: org: ${orgId}, packageId: ${packageId}, version: ${version}, packageType: ${packageType}, token: ${token}`); + console.log( + `Args: org: ${orgId}, packageId: ${packageId}, version: ${version}, packageType: ${packageType}, token: ${token}`, + ); if (orgId === undefined) { throw new Error("Organization is required"); @@ -84,7 +85,13 @@ const main = async () => { throw new Error("GitHub API token is required"); } - await deletePackageVersionAsync(orgId, packageId, version, packageType, token); + await deletePackageVersionAsync( + orgId, + packageId, + version, + packageType, + token, + ); }; console.log(`main: ${main}`); diff --git a/Scripts/ts/github-cli-types.ts b/Scripts/ts/github-cli-types.ts index cc9d202f064..70ae01f9182 100644 --- a/Scripts/ts/github-cli-types.ts +++ b/Scripts/ts/github-cli-types.ts @@ -1,38 +1,45 @@ -/* - * github-cli-types.ts - * - * Created: 2022-11-27-05:39:27 - * Modified: 2022-12-05-04:14:47 - * - * Author: David G. Moore, Jr. - * - * Copyright © 2022-2023 David G. Moore, Jr., All Rights Reserved - * License: MIT (https://opensource.org/licenses/MIT) - */ -import { SemVer } from "semver"; - -export interface PackageVersion { - id: number; - name: string; - package_html_url: string; - url: string; - created_at: string; - updated_at: string; - visibility: string; - package_type: PackageType; - downloads_count: number; - description: string; - html_url: string; - license: string; -} - -export interface ApiMessage { - message: string; - documentation_url: string; -} - -export type PackageType = "nuget" | "npm" | "docker" | "maven" | "rubygems" | "container"; - - -export const toSemVer = (stringVer: string | undefined) => new SemVer(stringVer ?? "0.0.0"); -export const toPackageType = (stringType: string | undefined) => stringType as PackageType; +/* + * github-cli-types.ts + * + * Created: 2022-11-27-05:39:27 + * Modified: 2022-12-05-04:14:47 + * + * Author: David G. Moore, Jr. + * + * Copyright © 2022-2023 David G. Moore, Jr., All Rights Reserved + * License: MIT (https://opensource.org/licenses/MIT) + */ +import { SemVer } from "semver"; + +export interface PackageVersion { + id: number; + name: string; + package_html_url: string; + url: string; + created_at: string; + updated_at: string; + visibility: string; + package_type: PackageType; + downloads_count: number; + description: string; + html_url: string; + license: string; +} + +export interface ApiMessage { + message: string; + documentation_url: string; +} + +export type PackageType = + | "nuget" + | "npm" + | "docker" + | "maven" + | "rubygems" + | "container"; + +export const toSemVer = (stringVer: string | undefined) => + new SemVer(stringVer ?? "0.0.0"); +export const toPackageType = (stringType: string | undefined) => + stringType as PackageType;