-
-
Notifications
You must be signed in to change notification settings - Fork 376
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
Add option mimeTypesForce #349
Conversation
Codecov Report
@@ Coverage Diff @@
## master #349 +/- ##
======================================
Coverage 96.8% 96.8%
======================================
Files 7 7
Lines 250 250
======================================
Hits 242 242
Misses 8 8
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #349 +/- ##
==========================================
+ Coverage 96.8% 96.82% +0.02%
==========================================
Files 7 7
Lines 250 252 +2
==========================================
+ Hits 242 244 +2
Misses 8 8
Continue to review full report at Codecov.
|
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.
Looks good, what about avoid new option in favor reuse existing. Example:
{
mimeTypes: {'foo' => [bar]}
}
Reuse current option.
{
mimeTypes: { typeMap: ['foo' => [bar]], force: true }
}
In code we just check:
if (options.mimeTypes) {
let typeMap = options.mimeTypes;
let force = false;
if (options.mimeTypes.typeMap) {
typeMap = options.mimeTypes.typeMap;
force = options.mimeTypes.force
}
mime.define(typeMap, force);
}
@evilebottnawi good idea. done. |
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.
Good job.
What kind of change does this PR introduce?
Feature
Did you add tests for your changes?
Yes
Summary
Exposes the force option to the underlying node-mime module.
See: #346
Does this PR introduce a breaking change?
No