-
Notifications
You must be signed in to change notification settings - Fork 22
feat: add whitelist of image extenstions which can be compressed #215
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
Conversation
|
Preview is ready. |
src/utils/imageCompress.ts
Outdated
| @@ -0,0 +1,8 @@ | |||
| export enum AvailableForCompressExtention { | |||
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.
small typos extenSion
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.
fixed
src/utils/imageCompress.ts
Outdated
| } | ||
|
|
||
| export const canBeCompressed = (fileName: string) => | ||
| Object.keys(AvailableForCompressExtention).find((ext) => fileName.endsWith(`.${ext}`)); |
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.
.some work similarly like .find, but always return boolean. If we need boolean in disableWebp variable always, we need to use .some
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.
ok
8493a2b to
7f284cd
Compare
No description provided.