From 89776267ad4c7c3260ed3c69b8dd3ffed03bc9b9 Mon Sep 17 00:00:00 2001 From: p-sw Date: Tue, 11 Jun 2024 18:01:35 +0900 Subject: [PATCH] refactor(cli): remove redundant functions in registry.ts Three functions have been removed to simplify the `registry.ts` file in the CLI package. These functions are `getComponentName`, `getComponentLibVersion`, and `getLibURL`, which are no longer required. This commit contributes to making the codebase cleaner and more maintainable. --- packages/cli/src/helpers/registry.ts | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/packages/cli/src/helpers/registry.ts b/packages/cli/src/helpers/registry.ts index d9c6dff..dcecebd 100644 --- a/packages/cli/src/helpers/registry.ts +++ b/packages/cli/src/helpers/registry.ts @@ -30,18 +30,3 @@ export async function getComponentRealname( ): Promise { return registry.components[componentName].name } - -export async function getComponentLibVersion( - registry: Registry, - componentName: keyof (typeof registry)['components'], -): Promise<{ok: boolean; libVersion: string}> { - const libVersion = registry.components[componentName].libVersion - if (!registry.lib.includes(libVersion)) { - return {ok: false, libVersion} - } - return {ok: true, libVersion} -} - -export async function getLibURL(registry: Registry, version: string): Promise { - return registry.base + registry.paths.lib.replace('{version}', version) -}