Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better type for Registers #26

Open
mkermani144 opened this issue Feb 16, 2023 · 0 comments
Open

Better type for Registers #26

mkermani144 opened this issue Feb 16, 2023 · 0 comments

Comments

@mkermani144
Copy link

It seems that Registers type is not narrow enough:

export type Registers = {[key: string]: HexString}

The user may provide any string value as key, which is not correct.

It can be fixed easily with a mapped type:

- export type Registers = {[key: string]: HexString} 
+ export type Registers = {[Key in RegisterId]: HexString} 
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

No branches or pull requests

1 participant