Open karol-majewski opened 4 years ago
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.
options
filter
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.
filter: shrinkRay.filter
Solution
This: https://github.com/Alorel/shrink-ray/blob/f7cfcc7d5cf5d31ed8deadbfd717f80e64585a8c/index.d.ts#L17
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 providefilter
even when I have no customfilter
to provide.Offending code
Error message:
Workaround
I could do this:
but it strikes me as awkward and slightly redundant since adding
filter: shrinkRay.filter
doesn't affect the functionality in any way.Solution
This: https://github.com/Alorel/shrink-ray/blob/f7cfcc7d5cf5d31ed8deadbfd717f80e64585a8c/index.d.ts#L17
should be changed to:
What do you think?