cloudinary / cloudinary/js-transformation-builder-sdk
Transformation method parameters all missing `| string`
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
I'm working on an issue (https://github.com/colbyfayock/cloudinary-util/issues/53) that makes use of `CloudinaryImage.effect()`
The current version passes a string (and it works without typing (ie using `any`)), but `CloudinaryImage.effect` only takes `EffectActions`. I couldn't figure out how it still worked until I got here.
`Cloudinary.effect()` is basically passed straight through to Transformation.effect here:
https://github.com/cloudinary/js-transformation-builder-sdk/blob/61a3606d9ee348b74245de4e819a0a1bfa4b2da7/src/transformation/Transformation.ts#L203-L205
Which in turn is passed straight to `Transformation.addAction`.
https://github.com/cloudinary/js-transformation-builder-sdk/blob/61a3606d9ee348b74245de4e819a0a1bfa4b2da7/src/transformation/Transformation.ts#L48-L61
The original call worked with a string because `addAction` takes a string or an `Action`, which seems really good. Many Cloudinary users I expect are used to thinking about string values for these things, or at least would expect that to work (ie `img.effect('e_tint:40:253f8c`)` alongside `img.effect(Adjust.tint('40:253f8c'))`.
### Proposed solution:
Update all of the methods for `Transformation` that pass their parameters along to `addAction` to accept a string as well as their assigned transform type.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in src/transformation/Transformation.ts, especially Transformation.effect and addAction around the referenced lines. Inspect the other Transformation methods that pass parameters to addAction and compare their parameter types. Done means those methods accept string values alongside their assigned transform types while preserving the existing Action behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100