diff --git a/MIGRATING_V5-V6.md b/MIGRATING_V5-V6.md index 1d24cc8650..21a8bdac38 100644 --- a/MIGRATING_V5-V6.md +++ b/MIGRATING_V5-V6.md @@ -13,8 +13,9 @@ But that comes with breaking changes to to reduce the risk of "getting around" t - AuthInfo.getFields now returns a read-only object. Use AuthInfo.update to change values in the fields. - `setContents` method is no longer available in the ConfigFile stack. Use `update` to merge in multiple props, or `set/unset` on a single prop. - `write` and `writeSync` method no longer accepts a param. Use other methods (`set`, `unset`, `update) to make modifications, then call write()/writeSync() to do the write. -- the use of lodash-style `get`/`set` (ex: `set('foo.bar.baz[0]', 3)`) no longer works. -- You can no longer override the `setMethod` and `getMethod`` when extending classes built on ConfigFile. Technically you could override get/set, but DON'T! +- the use of lodash-style `get`/`set`/`unset`/`unsetAll` (ex: `set('foo.bar.baz[0]', 3)`) no longer works. +- `awaitEach` is removed +- You can no longer override the `setMethod` and `getMethod` when extending classes built on ConfigFile. Technically you could override get/set, but DON'T! - Everything related to tokens/tokenConfig is gone ## Unrelated changes that we did because it's a major version diff --git a/src/config/configStore.ts b/src/config/configStore.ts index 389b846e37..99f4a42460 100644 --- a/src/config/configStore.ts +++ b/src/config/configStore.ts @@ -35,7 +35,6 @@ export interface ConfigStore
{
values(): ConfigValue[];
forEach(actionFn: (key: string, value: ConfigValue) => void): void;
- awaitEach(actionFn: (key: string, value: ConfigValue) => Promise {
public get state(): LWWState {
return Object.fromEntries(
- Array.from(this.#data.entries())
- // .filter(([, register]) => Boolean(register))
- .map(([key, register]) => [key, register.state])
+ Array.from(this.#data.entries()).map(([key, register]) => [key, register.state])
) as LWWState ;
}
diff --git a/test/unit/config/configStoreTest.ts b/test/unit/config/configStoreTest.ts
index 7dd2805d98..577cff023e 100644
--- a/test/unit/config/configStoreTest.ts
+++ b/test/unit/config/configStoreTest.ts
@@ -48,17 +48,6 @@ describe('ConfigStore', () => {
});
expect(st).to.equal('1a2b');
});
- it('await each value', async () => {
- const config = await TestConfig.create();
- config.set('1', 'a');
- config.set('2', 'b');
-
- let st = '';
- await config.awaitEach(async (key, val) => {
- st += `${key}${val}`;
- });
- expect(st).to.equal('1a2b');
- });
it('returns the object reference', async () => {
const config = new TestConfig<{ '1': { a: string } }>();