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 #27

Closed
mkermani144 opened this issue Feb 16, 2023 · 1 comment
Closed

Better type for Registers #27

mkermani144 opened this issue Feb 16, 2023 · 1 comment

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} 
@mkermani144
Copy link
Author

mkermani144 commented Feb 19, 2023

Duplicate of #26. I don't know why two same issues were submitted, maybe a network issue.

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