Skip to content

Commit 7d7e175

Browse files
authored
fix 0 being treated as falsy in param filters
1 parent dc19a62 commit 7d7e175

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bitpatty/next-image-s3-imgproxy-loader",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "imgproxy S3 extension for next/image",
55
"author": "Matteias Collet <[email protected]>",
66
"main": "dist/index.js",

src/param-builder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class ImgProxyParamBuilder {
3939
width,
4040
height,
4141
...[gravity?.type, gravity?.center?.x, gravity?.center?.y].filter(
42-
(v) => !!v,
42+
(v) => v != null,
4343
),
4444
].join(':'),
4545
);
@@ -75,7 +75,7 @@ class ImgProxyParamBuilder {
7575
!!enlarge,
7676
!!extend,
7777
...[gravity?.type, gravity?.center?.x, gravity?.center?.y].filter(
78-
(v) => !!v,
78+
(v) => v != null,
7979
),
8080
].join(':')
8181
: ['resize', type ?? 'fit'].join(':'),

0 commit comments

Comments
 (0)