Skip to content

util: add non-throwing MIMEType.parse - #64965

Open
jasnell wants to merge 2 commits into
nodejs:mainfrom
jasnell:jasnell/add-mimetype-parse
Open

util: add non-throwing MIMEType.parse#64965
jasnell wants to merge 2 commits into
nodejs:mainfrom
jasnell:jasnell/add-mimetype-parse

Conversation

@jasnell

@jasnell jasnell commented Aug 2, 2026

Copy link
Copy Markdown
Member

Similar to URL.parse(...), the MIMEType.parse(...) API will return null if the input cannot be parsed as opposed to throwing the way the constructor does.

Similar to `URL.parse(...)`, the `MIMEType.parse(...)` API will
return `null` if the input cannot be parsed as opposed to throwing
the way the constructor does.

Signed-off-by: James M Snell <jasnell@gmail.com>
@jasnell jasnell added the semver-minor PRs that contain new features and should be released in the next minor version. label Aug 2, 2026
@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Aug 2, 2026
@nodejs-github-bot

This comment was marked as outdated.

Signed-off-by: James M Snell <jasnell@gmail.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@codecov

codecov Bot commented Aug 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.30%. Comparing base (c55eb4a) to head (5028c0c).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #64965   +/-   ##
=======================================
  Coverage   90.30%   90.30%           
=======================================
  Files         760      760           
  Lines      247238   247243    +5     
  Branches    46623    46625    +2     
=======================================
+ Hits       223259   223264    +5     
- Misses      15448    15454    +6     
+ Partials     8531     8525    -6     
Files with missing lines Coverage Δ
lib/internal/data_url.js 100.00% <100.00%> (ø)
lib/internal/inspector/network.js 96.73% <100.00%> (+0.77%) ⬆️
lib/internal/mime.js 98.55% <100.00%> (+0.06%) ⬆️

... and 28 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@panva panva added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. needs-ci PRs that need a full CI run. semver-minor PRs that contain new features and should be released in the next minor version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants