add deprecation message

This commit is contained in:
Pierre Noël 2022-06-16 19:49:30 +01:00
parent 0fbcd89ec8
commit 0039c33952

View File

@ -160,6 +160,15 @@ const breakpointSmallerThan = (breakpoint, { width, height }) => {
return breakpoint < width || breakpoint < height;
};
// TODO V5: remove isSupportedImage
const isSupportedImage = (...args) => {
process.emitWarning(
'[deprecated] In future versions, `isSupportedImage` will be removed. Replace it with `isImage` or `isOptimizableImage` instead.'
);
return isOptimizableImage(...args);
};
const isOptimizableImage = async file => {
let format;
try {
@ -185,6 +194,7 @@ const isImage = async file => {
};
module.exports = () => ({
isSupportedImage,
isOptimizableImage,
isImage,
getDimensions,