Skip to content

Implementing the Unconvert and UnconvertWithChecksum method#1

Merged
r0ssing merged 2 commits intomainfrom
idrissa
May 17, 2023
Merged

Implementing the Unconvert and UnconvertWithChecksum method#1
r0ssing merged 2 commits intomainfrom
idrissa

Conversation

@ibanora
Copy link
Copy Markdown
Collaborator

@ibanora ibanora commented May 17, 2023

No description provided.

Copy link
Copy Markdown
Contributor

@r0ssing r0ssing left a comment

Choose a reason for hiding this comment

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

This looks good to me - maybe refactor based on my comment, and then we can merge it! :-)

return { error: false, value: decimalValue };
} else {
return { error: true, value: NaN };
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe we could consider refactoring this in a way so we only have one return-statement?
If you prefer?

const error = checksum !== this.Convert(strCode % 26);
const value = error ? NaN : this.Unconvert(strCode);

return { error, value };

Copy link
Copy Markdown
Contributor

@r0ssing r0ssing left a comment

Choose a reason for hiding this comment

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

Looks great!

@r0ssing r0ssing merged commit afa206d into main May 17, 2023
@r0ssing r0ssing deleted the idrissa branch May 17, 2023 11:28
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