-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
feat(base64-string-converter): switch to encode and decode url safe #392
feat(base64-string-converter): switch to encode and decode url safe #392
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Thanks for the changes 🙏🏻
Really love the new unit tests 💪🏻
Just small request changes
src/utils/base64.ts
Outdated
} | ||
|
||
function base64ToText(str: string) { | ||
if (!isValidBase64(str)) { | ||
function base64ToText(str: string, urlSafe = false) { |
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.
I'm not really fan of magic boolean positionnal arguments, can you make this argument a config object please ?
function base64ToText(str: string, urlSafe = false) { | |
function base64ToText(str: string, { makeUrlSafe = false } : { makeUrlSafe?: boolean } = {}) { |
src/utils/base64.ts
Outdated
@@ -22,12 +26,33 @@ function removePotentialDataAndMimePrefix(str: string) { | |||
return str.replace(/^data:.*?;base64,/, ''); | |||
} | |||
|
|||
function isValidBase64(str: string) { | |||
const cleanStr = removePotentialDataAndMimePrefix(str); | |||
function isValidBase64(str: string, urlSafe = false) { |
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.
Same here
function isValidBase64(str: string, urlSafe = false) { | |
function isValidBase64(str: string, { decodeUrlSafe = false } : { decodeUrlSafe?: boolean } = {}) { |
…config object instead of boolean argument.
* main: refactor(ui): replaced some n-input with c-input-text chore(version): release 2023.05.14-77f2efc docs(changelog): update changelog for 2023.05.14-77f2efc refactor(ui): replaced some n-input with c-input-text ui-lib(new-component): added text input component in the c-lib ui-lib(button): size variants chore(issues): updated new tool request issue template # Conflicts: # src/tools/base64-string-converter/base64-string-converter.vue
…ditional refs for changes which interfere with validation rules
* main: fix(ipv4-converter): removed readonly on input
Kudos, SonarCloud Quality Gate passed!
|
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.
Nice, thanks
fixes #376