Skip to content

Commit 60447ca

Browse files
committed
refactor: clean up supportedTransforms and improve type definition for original property
1 parent 95d954e commit 60447ca

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

src/constants/supportedTransforms.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ export const supportedTransforms: { [key: string]: string } = {
6565
zoom: "z",
6666
page: "pg",
6767

68-
69-
7068
// Raw pass-through
7169
raw: "raw",
7270
};

src/interfaces/Transformation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export interface Transformation {
141141
/**
142142
* Whether to serve the original file without any transformations if `true`.
143143
*/
144-
original?: true
144+
original?: boolean;
145145

146146
/**
147147
* Start offset (in seconds) for trimming videos. e.g., `5` or `"10.5"`.

test/url-generation.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,11 +406,12 @@ describe("URL generation", function () {
406406
effectShadow: 'bl-15_st-40_x-10_y-N5',
407407
effectGradient: 'from-red_to-white',
408408
original: true,
409+
page: "2_4",
409410
raw: "h-200,w-300,l-image,i-logo.png,l-end"
410411
}]
411412
})
412413

413-
expect(url).equal(`https://ik.imagekit.io/test_url_endpoint/tr:h-300,w-400,ar-4-3,q-40,c-force,cm-extract,fo-left,f-jpeg,r-50,bg-A94D34,b-5-A94D34,rt-90,bl-10,n-some_name,pr-true,lo-true,t-5,md-true,cp-true,di-folder@@file.jpg,dpr-3,e-sharpen-10,e-usm-2-2-0.8-0.024,e-contrast,e-grayscale,e-shadow-bl-15_st-40_x-10_y-N5,e-gradient-from-red_to-white,orig-true,h-200,w-300,l-image,i-logo.png,l-end/test_path.jpg`);
414+
expect(url).equal(`https://ik.imagekit.io/test_url_endpoint/tr:h-300,w-400,ar-4-3,q-40,c-force,cm-extract,fo-left,f-jpeg,r-50,bg-A94D34,b-5-A94D34,rt-90,bl-10,n-some_name,pr-true,lo-true,t-5,md-true,cp-true,di-folder@@file.jpg,dpr-3,e-sharpen-10,e-usm-2-2-0.8-0.024,e-contrast,e-grayscale,e-shadow-bl-15_st-40_x-10_y-N5,e-gradient-from-red_to-white,orig-true,pg-2_4,h-200,w-300,l-image,i-logo.png,l-end/test_path.jpg`);
414415
});
415416
});
416417

0 commit comments

Comments
 (0)