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.
This commit is contained in:
parent
dd63fcb753
commit
89776267ad
@ -30,18 +30,3 @@ export async function getComponentRealname(
|
||||
): Promise<string> {
|
||||
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<string> {
|
||||
return registry.base + registry.paths.lib.replace('{version}', version)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user