You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve the return type of cloudinary.v2.config() in TypeScript (#494)
* Improve the return type of cloudinary.v2.config()
- The original typescript definition was to return void, but the
actual code always returns something, either the config or a property.
- Calls will generally return the ConfigOptions
const config = cloudinary.v2.config()
- A string parameter works like a getter, returning the property
cloudinary.v2.config("private_cdn") === true
- Two parameters acts like a setter, but returns the config object
const config = cloudinary.v2.config("private_cdn", true)
- If the function gets two parameters, but the 2nd is undefined, it
acts like the getter instead of setting the config key to undefined
cloudinary.v2.config("private_cdn", undefined) === true
0 commit comments