feat: add Base64 encoder/decoder tool#22
feat: add Base64 encoder/decoder tool#22saishreeanand05 wants to merge 5 commits intosg172003:mainfrom
Conversation
|
@saishreeanand05 is attempting to deploy a commit to the sg172003's projects Team on Vercel. A member of the Team first needs to authorize it. |
sg172003
left a comment
There was a problem hiding this comment.
Great work on the implementation! A few things to fix before this can be merged:
1. Missing entry in Navbar allTools
The Base64 tool is missing from allTools in src/components/Navbar.tsx. Without this, the tool won't appear in the search bar or nav links.
Please add this entry to the allTools array:
{ to: '/base64', label: 'Base64 Encoder / Decoder', description: 'Encode text to Base64 or decode Base64 strings in your browser' },
The navLinks array derives from allTools automatically so that will update too.
2. Duplicate wrapper div in Base64Tool.tsx
In the header section there is a redundant nested div — the inner div is identical to the outer and serves no purpose. Please remove the inner wrapper div to clean up the JSX structure.
3. Missing test case in base64Utils.test.ts
The test suite is missing a whitespace handling test for decodeBase64. Real-world JWTs and Base64 strings often get copied with trailing spaces or newlines. Please add:
it('handles whitespace around Base64 input', () => {
expect(decodeBase64(' SGVsbG8gV29ybGQ= '.trim())).toBe('Hello World');
});
Once all three are addressed the PR is good to merge.
|
Thanks for the review! I've addressed all the requested changes:
Also updated Let me know if anything else needs improvement! |
sg172003
left a comment
There was a problem hiding this comment.
Almost there, good progress! Just two small things left:
-
Wrong test folder — the file landed in
src/tests/but the project
usessrc/__tests__/. Can you movebase64Utils.test.tsthere to keep
things consistent with the other test files? -
The
tsconfig.app.jsonchange needs to be reverted — adding
vitest/globalsto the production TS config leaks test types into the
app build. The other test files in this project use explicit imports
(import { describe, it, expect } from 'vitest') which is the right
approach. Please remove that line and use explicit imports in the new
test file too.
Everything else looks solid — once these two are sorted we're good to merge! 🙌
|
Thanks for the review! I've addressed the requested changes:
All tests are passing and build succeeds. Please take another look. |
Description
Adds a Base64 Encoder / Decoder tool to the application.
This PR introduces utility functions for Base64 encoding and decoding, along with a dedicated UI page to allow users to encode text into Base64 or decode Base64 strings directly in the browser. All processing is performed client-side to maintain user privacy.
Changes
encodeBase64anddecodeBase64utilities insrc/utils/base64Utils.tssrc/__tests__/base64Utils.test.tsBase64Toolpage for encoding and decoding Base64Type of Change
Checklist
npx vitest run)npm run build)Screenshots (if UI change)