-
Notifications
You must be signed in to change notification settings - Fork 61
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
fix: issue 1381 using startWiths instead of substring for check stringg prefixess #1557
Closed
Closed
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ebf862a
fix: issue 1381 using startWiths instead of substring for check strin…
0xTylerD26 659a160
style: update space for enhance the readability and maintainability o…
0xTylerD26 c536694
Update web-ui/utils/string.ts
tuantran1702 b65d503
Merge branch 'main' into fix/iss-1381-using-startWith
tiendn aa2c74d
Merge branch 'main' into fix/iss-1381-using-startWith
tuantran1702 9c797cc
fix: remove dup code
0xTylerD26 37f6349
Merge branch 'main' into fix/iss-1381-using-startWith
tuantran1702 77cd9b0
Merge branch 'main' into fix/iss-1381-using-startWith
tuantran1702 5652eb9
Merge branch 'main' into fix/iss-1381-using-startWith
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
export function formatQasset(denom: string): string { | ||
if (denom.substring(0, 1) == "Q" || denom.substring(0, 2) == "AQ"){ | ||
return "q"+denom.substring(1) | ||
} | ||
return denom | ||
if (denom.startsWith('Q') || denom.startsWith('AQ')) { | ||
return 'q' + denom.substring(1); | ||
} | ||
|
||
return denom; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure consistent return format for
formatQasset
.The function
formatQasset
is documented to return a string, but the format of the returned string varies depending on the condition. Ifdenom
starts with "Q" or "AQ", it returns"q" + denom.substring(1)
, which alters the string. Otherwise, it returnsdenom
unchanged. Consider normalizing the return format or clarifying the function's purpose and expected behavior in the documentation.Improve code formatting for better readability.
Adding spaces around operators and after conditions, as well as semicolons at the end of statements, will enhance the readability and maintainability of the code.
Committable suggestion