Conditional

Description

Sets up a conditional transformation.

Examples

			import {Cloudinary} from "@cloudinary/url-gen";
			
			const yourCldInstance = new Cloudinary({cloud:{cloudName:'demo'}});
			const image = yourCldInstance.image('woman');
			image.conditional(
			 Conditional.ifCondition('ar >= 1.0', new Transformation().addAction('w_100'))
			);
			image.toString()
			// Transformation will contain `if_ar_gte_1.0/w_100/if_end`

Classes


new ConditionalAction( exp, ifTx )

Methods


<static> ifCondition( expression, tx ) → {Actions.Conditional.ConditionalAction}

action

Description

Sets up a conditional transformation with expression. Learn more: Conditional transformations

Parameters
Name Type Description
expression string

The condition to meet in order to apply the transformation.

tx SDK.Transformation

The transformation to conditionally apply