From 64e772fc4173c045fab579387bfd51bdb21ac025 Mon Sep 17 00:00:00 2001 From: Ricardo Devis Agullo Date: Thu, 4 Jan 2024 21:06:10 +0100 Subject: [PATCH 1/2] fix not adding oc-client on dev mode multiple times --- src/registry/domain/repository.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/registry/domain/repository.ts b/src/registry/domain/repository.ts index 746daec61..b4e30e022 100644 --- a/src/registry/domain/repository.ts +++ b/src/registry/domain/repository.ts @@ -76,7 +76,9 @@ export default function repository(conf: Config) { return isValidComponent; }); - validComponents.push('oc-client'); + if (!validComponents.includes('oc-client')) { + validComponents.push('oc-client'); + } return validComponents; }, getComponentVersions(componentName: string): Promise { @@ -356,9 +358,8 @@ export default function repository(conf: Config) { }; } - const componentVersions = await repository.getComponentVersions( - componentName - ); + const componentVersions = + await repository.getComponentVersions(componentName); if ( !versionHandler.validateNewVersion(componentVersion, componentVersions) From bc6a4312473da5a6aca1a87ef96835847332e71c Mon Sep 17 00:00:00 2001 From: Ricardo Devis Agullo Date: Thu, 4 Jan 2024 21:09:01 +0100 Subject: [PATCH 2/2] just dont mutate --- src/registry/domain/repository.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/registry/domain/repository.ts b/src/registry/domain/repository.ts index b4e30e022..0fcc71690 100644 --- a/src/registry/domain/repository.ts +++ b/src/registry/domain/repository.ts @@ -76,10 +76,7 @@ export default function repository(conf: Config) { return isValidComponent; }); - if (!validComponents.includes('oc-client')) { - validComponents.push('oc-client'); - } - return validComponents; + return [...validComponents, 'oc-client']; }, getComponentVersions(componentName: string): Promise { if (componentName === 'oc-client') {