Skip to content

Fix Remaining permission and group typing - #12

Merged
airbreather merged 1 commit into
airbreather:mainfrom
DrAwesome4333:typing-fixes-round-2
Oct 25, 2026
Merged

airbreather merged 1 commit into
airbreather:mainfrom
DrAwesome4333:typing-fixes-round-2

Conversation

@DrAwesome4333

@DrAwesome4333 DrAwesome4333 commented Oct 25, 2026 •

Copy link
Copy Markdown

Fixes 2 typing errors:
fetchItemNameGroups and fetchLocationNameGroups do not currently strip the outer object returned by the data storage operation, meaning the groups need an extra step to extract them like so:

const locationGroups: { [groupName: string]: string[] } =
    await this.client.storage
        .fetchLocationNameGroups(game)
        .then(
            (a) => a[`_read_location_name_groups_${game}`]
        );
const itemGroups: { [groupName: string]: string[] } =
    await this.client.storage
        .fetchItemNameGroups(game)
        .then((a) => a[`_read_item_name_groups_${game}`]);

however only the inner record was typed, not the outer record producing type errors.

The long term fix would be to automatically strip the outer object to return the groups themselves, that would be a breaking change.

The other typing error fixes was for remaining permission. Previously they used the Omit helper which omits properties, not values. The proper helper to use is the Exclude helper, which excludes vales from a different type.

Now the type properly shows the valid values, instead of an odd type that produces errors.

Before:

image

After:

image

Tested these and was able to compile code without ts-ignore or ts-expect-error comments for code does work at runtime.

@airbreather
airbreather merged commit b1b22ce into airbreather:main Oct 25, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants