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

port: fix failing test + support extended token #8

Merged
merged 1 commit into from
Jul 8, 2024
Merged

Conversation

beesaferoot
Copy link
Collaborator

No description provided.

@beesaferoot beesaferoot requested a review from dmohns July 5, 2024 18:27
Comment on lines 72 to 74
static convertFrom4digitToken(token) {
// 4 - digit token value
let bitArray = []
for (let digit of token.toString()) {
digit = Number(digit) - 1
const tempArr = bitArrayFromInt(digit, 2)
bitArray = bitArray.concat(tempArr)
}
return bitArrayToInt(bitArray)
return convertFrom4digitToken(token)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it required to have the function convertFrom4digitToken twice? As a class function and as a global? This functional declaration seems a bit odd to the viewer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does look odd, but the reason for it is to avoid duplicating the function in both classes (shared/extended)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, understood 🎉

Copy link
Member

@dmohns dmohns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

@beesaferoot beesaferoot merged commit 9c8f91f into main Jul 8, 2024
2 checks passed
@beesaferoot beesaferoot deleted the js-port branch July 8, 2024 13:01
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