Skip to content

Commit d9fa8ff

Browse files
committed
fix: handle empty transformation keys in URL construction
1 parent 6d72361 commit d9fa8ff

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/url/builder.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ function constructTransformationString(transformation: Transformation[] | undefi
9292
transformKey = key;
9393
}
9494

95+
if (transformKey === "") {
96+
continue;
97+
}
98+
9599
if (
96100
["e-grayscale", "e-contrast", "e-removedotbg", "e-bgremove", "e-upscale", "e-retouch", "e-genvar"].includes(transformKey)
97101
) {
@@ -123,7 +127,9 @@ function constructTransformationString(transformation: Transformation[] | undefi
123127
parsedTransformStep.push([transformKey, value].join(transformationUtils.getTransformKeyValueDelimiter()));
124128
}
125129
}
126-
parsedTransforms.push(parsedTransformStep.join(transformationUtils.getTransformDelimiter()));
130+
if (parsedTransformStep.length) {
131+
parsedTransforms.push(parsedTransformStep.join(transformationUtils.getTransformDelimiter()));
132+
}
127133
}
128134

129135
return parsedTransforms.join(transformationUtils.getChainTransformDelimiter());

0 commit comments

Comments
 (0)