Skip to content

Commit c43afd8

Browse files
committed
ESLint fixes
1 parent c482de6 commit c43afd8

File tree

3 files changed

+76
-64
lines changed

3 files changed

+76
-64
lines changed

components/cloudinary/actions/image-transformation/image-transformation.mjs

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ export default {
1111
assetId: {
1212
propDefinition: [
1313
cloudinary,
14-
"assetId"
15-
]
14+
"assetId",
15+
],
1616
},
1717
width: {
1818
type: "integer",
@@ -43,25 +43,27 @@ export default {
4343
transformations: {
4444
propDefinition: [
4545
cloudinary,
46-
"transformations"
47-
]
46+
"transformations",
47+
],
4848
},
4949
},
5050
async run({ $ }) {
51-
const { cloudinary, assetId, transformations, ...options } = this;
51+
const {
52+
cloudinary, assetId, transformations, ...options
53+
} = this;
5254
try {
53-
const response = await cloudinary.transformAsset(assetId, {
54-
...options,
55-
...transformations,
56-
});
55+
const response = await cloudinary.transformAsset(assetId, {
56+
...options,
57+
...transformations,
58+
});
5759

58-
if (response) {
59-
$.export("$summary", "Successfully transformed image");
60-
}
60+
if (response) {
61+
$.export("$summary", "Successfully transformed image");
62+
}
6163

62-
return response;
63-
} catch (err) {
64-
throw new Error(`Cloudinary error response: ${err.error?.message ?? JSON.stringify(err)}`);
65-
}
64+
return response;
65+
} catch (err) {
66+
throw new Error(`Cloudinary error response: ${err.error?.message ?? JSON.stringify(err)}`);
67+
}
6668
},
6769
};

components/cloudinary/actions/resource-transformation/resource-transformation.mjs

Lines changed: 44 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -8,52 +8,54 @@ export default {
88
type: "action",
99
props: {
1010
cloudinary,
11-
assetId: {
12-
propDefinition: [
13-
cloudinary,
14-
"assetId"
15-
]
16-
},
17-
width: {
18-
type: "integer",
19-
label: "Width",
20-
description: "The new width of the video, e.g. `854`",
21-
optional: true,
22-
},
23-
height: {
24-
type: "integer",
25-
label: "Height",
26-
description: "The new height of the video, e.g. `480`",
27-
optional: true,
28-
},
29-
duration: {
30-
type: "integer",
31-
label: "Duration",
32-
description: "The duration to set for the video in seconds, e.g. `30`",
33-
optional: true,
34-
},
35-
transformations: {
36-
propDefinition: [
37-
cloudinary,
38-
"transformations"
39-
]
40-
},
11+
assetId: {
12+
propDefinition: [
13+
cloudinary,
14+
"assetId",
15+
],
16+
},
17+
width: {
18+
type: "integer",
19+
label: "Width",
20+
description: "The new width of the video, e.g. `854`",
21+
optional: true,
22+
},
23+
height: {
24+
type: "integer",
25+
label: "Height",
26+
description: "The new height of the video, e.g. `480`",
27+
optional: true,
28+
},
29+
duration: {
30+
type: "integer",
31+
label: "Duration",
32+
description: "The duration to set for the video in seconds, e.g. `30`",
33+
optional: true,
34+
},
35+
transformations: {
36+
propDefinition: [
37+
cloudinary,
38+
"transformations",
39+
],
40+
},
4141
},
4242
async run({ $ }) {
43-
const { cloudinary, assetId, transformations, ...options } = this;
43+
const {
44+
cloudinary, assetId, transformations, ...options
45+
} = this;
4446
try {
45-
const response = await cloudinary.transformAsset(assetId, {
46-
...options,
47-
...transformations,
48-
});
47+
const response = await cloudinary.transformAsset(assetId, {
48+
...options,
49+
...transformations,
50+
});
4951

50-
if (response) {
51-
$.export("$summary", "Successfully transformed video");
52-
}
52+
if (response) {
53+
$.export("$summary", "Successfully transformed video");
54+
}
5355

54-
return response;
55-
} catch (err) {
56-
throw new Error(`Cloudinary error response: ${err.error?.message ?? JSON.stringify(err)}`);
57-
}
56+
return response;
57+
} catch (err) {
58+
throw new Error(`Cloudinary error response: ${err.error?.message ?? JSON.stringify(err)}`);
59+
}
5860
},
5961
};

components/cloudinary/actions/upload-media-asset/upload-media-asset.mjs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import cloudinary from "../../cloudinary.app.mjs";
2-
import fs from 'fs';
32

43
export default {
54
key: "cloudinary-upload-media-asset",
@@ -12,7 +11,7 @@ export default {
1211
infoAlert: {
1312
type: "alert",
1413
alertType: "info",
15-
content: `Cloudinary offers a large amount of options to customize your asset upload. You can set any available options in the \`Additional Options\` prop. [See the Cloudinary documentation for more information.](https://cloudinary.com/documentation/image_upload_api_reference#upload_method)`
14+
content: "Cloudinary offers a large amount of options to customize your asset upload. You can set any available options in the `Additional Options` prop. [See the Cloudinary documentation for more information.](https://cloudinary.com/documentation/image_upload_api_reference#upload_method)",
1615
},
1716
file: {
1817
type: "string",
@@ -84,13 +83,22 @@ export default {
8483
tags: this.tags,
8584
format: this.format,
8685
backup: this.backup,
87-
...Object.fromEntries(Object.entries(this.additionalOptions ?? {}).map(([key, value]) => {
86+
...Object.fromEntries(Object.entries(this.additionalOptions ?? {}).map(([
87+
key,
88+
value,
89+
]) => {
8890
try {
89-
return [key, JSON.parse(value)]
91+
return [
92+
key,
93+
JSON.parse(value),
94+
];
9095
} catch (err) {
91-
return [key, value]
96+
return [
97+
key,
98+
value,
99+
];
92100
}
93-
})),
101+
})),
94102
};
95103

96104
try {

0 commit comments

Comments
 (0)