Hello and thank you for your work.
I noticed that when I want to pass some options, I'm required to provide filter even when I have no custom filter to provide.
Offending code
app.use(
shrinkRay({
brotli: {
mode: 11,
},
}),
);
Error message:
Argument of type '{ brotli: { mode: number; }; }' is not assignable to parameter of type 'ShrinkRayOptions'.
Property 'filter' is missing in type '{ brotli: { mode: number; }; }' but required in type 'ShrinkRayOptions'.ts(2345)
Workaround
I could do this:
app.use(
shrinkRay({
brotli: {
mode: 11,
},
filter: shrinkRay.filter,
}),
);
but it strikes me as awkward and slightly redundant since adding filter: shrinkRay.filter doesn't affect the functionality in any way.
Solution
This:
|
interface ShrinkRayOptions extends Filterable { |
should be changed to:
- interface ShrinkRayOptions extends Filterable {
+ interface ShrinkRayOptions extends Partial<Filterable> {
What do you think?
Hello and thank you for your work.
I noticed that when I want to pass some
options, I'm required to providefiltereven when I have no customfilterto provide.Offending code
Error message:
Workaround
I could do this:
but it strikes me as awkward and slightly redundant since adding
filter: shrinkRay.filterdoesn't affect the functionality in any way.Solution
This:
shrink-ray/index.d.ts
Line 17 in f7cfcc7
should be changed to:
What do you think?