From 70cefc00faef446685d0c6f381e83c8de5d6fb31 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Wed, 6 Nov 2024 03:48:39 +0100 Subject: [PATCH] fix(appdata): Fix iteration over overwriteObject in AppData class --- changelog.md | 5 +++++ ts/00_commitinfo_data.ts | 2 +- ts/npmextra.classes.appdata.ts | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index d59d495..c9ae4d3 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ # Changelog +## 2024-11-06 - 5.1.2 - fix(appdata) +Fix iteration over overwriteObject in AppData class + +- Corrected the for loop from in to of inside the AppData class for iterating over overwriteObject keys. + ## 2024-11-05 - 5.1.1 - fix(AppData) Fix issue with overwrite object handling in AppData class diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index fa48c38..ff191ed 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/npmextra', - version: '5.1.1', + version: '5.1.2', description: 'A utility to enhance npm with additional configuration, tool management capabilities, and a key-value store for project setups.' } diff --git a/ts/npmextra.classes.appdata.ts b/ts/npmextra.classes.appdata.ts index 71d2968..c6df6f7 100644 --- a/ts/npmextra.classes.appdata.ts +++ b/ts/npmextra.classes.appdata.ts @@ -178,7 +178,7 @@ export class AppData { } if (this.options.overwriteObject) { - for (const key in Object.keys(this.options.overwriteObject)) { + for (const key of Object.keys(this.options.overwriteObject)) { console.log(`-> heads up: overwriting key ${key} from options.overwriteObject`); await this.kvStore.writeKey(key as keyof T, this.options.overwriteObject[key]); }