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

feat: add Base64 type support #8

Merged
merged 12 commits into from
Apr 29, 2024
Merged

feat: add Base64 type support #8

merged 12 commits into from
Apr 29, 2024

Conversation

itpropro
Copy link
Member

@itpropro itpropro commented Apr 4, 2024

πŸ”— Linked issue

#6

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Added Base64 and Base64Url types. There are exclusions in the tests, as both Base64 types cannot autodetected, as they are semantically overlapping with string. Therefore a new optional parameter for convertTo was introduced to overwrite the autodetection for the fromType.
This was the best way I found to keep the tests simple and to change as least of the api exposure as possible. Detection of the types is still implemented, but explicitly not integrated in detectType due to the detection overlap with string mentioned above.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@itpropro itpropro requested a review from pi0 April 4, 2024 01:00
Copy link

codecov bot commented Apr 4, 2024

Welcome to Codecov πŸŽ‰

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered β˜‚οΈ

@itpropro
Copy link
Member Author

itpropro commented Apr 4, 2024

If #9 is fine by you @pi0, I will adjust this one accordingly.

@pi0
Copy link
Member

pi0 commented Apr 29, 2024

Hi @itpropro thanks for PR ❀️

I have played little bit locally and merged url-safe version as an optional option of urlSafe to all methods this ways we can keep number of exposed mappers and functions minimal.

Merging this but later add more tests to make sure all utils works as expected.

@pi0 pi0 changed the title feat: added base64 and base64url types feat: add Base64 type support Apr 29, 2024
@pi0 pi0 merged commit d06d6e5 into main Apr 29, 2024
2 checks passed
@pi0 pi0 deleted the feat/base64 branch April 29, 2024 22:01
@pi0 pi0 mentioned this pull request Apr 29, 2024
@itpropro
Copy link
Member Author

itpropro commented Apr 30, 2024

Hi @itpropro thanks for PR ❀️

I have played little bit locally and merged url-safe version as an optional option of urlSafe to all methods this ways we can keep number of exposed mappers and functions minimal.

Merging this but later add more tests to make sure all utils works as expected.

I tried to stay as close to the other exposed interfaces and therefore created a separate url type to avoid additional tests and parameters as non of the others had them. The urlSafe option is actually how the initial version looked, so I like this change :)

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.

None yet

2 participants