Skip to content

Add MIME type detection support#33

Merged
melihbirim merged 5 commits intomelihbirim:mainfrom
OjasSinh:fix-merge-conflicts
Feb 22, 2026
Merged

Add MIME type detection support#33
melihbirim merged 5 commits intomelihbirim:mainfrom
OjasSinh:fix-merge-conflicts

Conversation

@OjasSinh
Copy link
Copy Markdown
Contributor

@OjasSinh OjasSinh commented Dec 21, 2025

Pull Request

Description

This PR adds MIME type detection support to improve the accuracy of data type prediction.

Related Issue

Fixes #24

Changes Made

  • Added MIME type detection logic
  • Integrated it with existing prediction flow
  • Updated documentation where necessary

Checklist

Required (PR will not be merged without these):

  • Synced with latest main branch (git rebase main)
  • All tests pass (npm test)
  • Linting passes (npm run lint)
  • README.md updated with:
    • Data type added to supported types list
    • Test count updated
    • Usage example added
  • TypeScript definitions added in index.d.ts
  • JSDoc documentation added for new functions

Code Quality:

  • Followed conventional commit format (feat:, fix:, style:, etc.)
  • Used single quotes (') not double quotes (")
  • No console.log statements in code
  • Functions added at the end of file (minimizes conflicts)
  • Test cases added at the end of test file
  • Pre-commit hook ran automatically (auto-fixed linting)

Test Results

Paste test output here

Avoiding Conflicts

  • I have rebased on the latest main branch before creating this PR
  • I understand that if conflicts occur, I need to resolve them by rebasing again

Thank you for contributing! 🎉

See CONTRIBUTING.md for detailed guidelines.

@OjasSinh
Copy link
Copy Markdown
Contributor Author

Hi! This was my first contribution .
Thanks for creating a beginner-friendly issue .

@melihbirim
Copy link
Copy Markdown
Owner

Thanks for your PR @OjasSinh Can you please check all the ticks in PR template.
We need to have README updates and other things to be placed correctly.

@OjasSinh
Copy link
Copy Markdown
Contributor Author

Hi! I’ve updated the README with MIME type support and added usage examples.
The PR checklist has also been updated. Thanks for the review!

@melihbirim
Copy link
Copy Markdown
Owner

Great @OjasSinh Can you please add unit tests and update test count as well.
also please check these items.
I have rebased on the latest main branch before creating this PR
I understand that if conflicts occur, I need to resolve them by rebasing again

@OjasSinh
Copy link
Copy Markdown
Contributor Author

Thanks for the review! I verified everything locally — all 75 tests are passing and the branch is up to date with the latest main.

@OjasSinh
Copy link
Copy Markdown
Contributor Author

Happy to make any further changes if needed.

@melihbirim
Copy link
Copy Markdown
Owner

Heya. Thanks for the PR. You need to add tests and categorise tests under mime type. And don push package.lock please.

@OjasSinh
Copy link
Copy Markdown
Contributor Author

Implementation is complete and verified locally. Removed package-lock.json. Merge conflicts have been resolved. Tests will be added in a follow-up commit.

@OjasSinh
Copy link
Copy Markdown
Contributor Author

Added MIME type detection tests as requested. All tests are now passing locally and in CI.

@OjasSinh
Copy link
Copy Markdown
Contributor Author

OjasSinh commented Jan 9, 2026

The workflow requires maintainer approval to run. Please let me know if you’d like me to make any changes.

@OjasSinh
Copy link
Copy Markdown
Contributor Author

hey can you tell me what is failing right now, because it is showing green tick on my workflow
Screenshot 2026-02-22 124125

Comment thread index.js Outdated
MENTION: 'mention',
CRON: 'cron',
HASHTAG: 'hashtag',
MIME: 'mime'
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

add , after 'mime'

Comment thread index.js Outdated
return 'phone';
} else if (isEmail(trimmedValue)) {
return 'email';
}else if (PATTERNS.MIME.test(trimmedValue)) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

please lint the file.

@OjasSinh
Copy link
Copy Markdown
Contributor Author

Changes pushed. Please review again

@melihbirim melihbirim merged commit 6648b27 into melihbirim:main Feb 22, 2026
7 checks passed
@melihbirim
Copy link
Copy Markdown
Owner

Thanks @OjasSinh

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.

Add MIME Type Detector

2 participants