Skip to content

Commit f2bdff2

Browse files
committed
Use undefined instead of delete for performance
1 parent ab734b6 commit f2bdff2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/core/image-asset/image-asset-common.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export function getRequestedImageSize(src: { width: number; height: number }, op
5555
optionsCopy.width = parsedWidth;
5656
} else {
5757
console.warn('Invalid width value provided: ', optionsCopy.width);
58-
delete optionsCopy.width;
58+
optionsCopy.width = undefined;
5959
}
6060
}
6161

@@ -65,7 +65,7 @@ export function getRequestedImageSize(src: { width: number; height: number }, op
6565
optionsCopy.height = parsedHeight;
6666
} else {
6767
console.warn('Invalid height value provided: ', optionsCopy.height);
68-
delete optionsCopy.height;
68+
optionsCopy.height = undefined;
6969
}
7070
}
7171

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy