Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const mergeTransformation = (transformation1, transformation2) => {
if (transformation1.constructor.name === 'Transformation' && transformation1.toOptions) {
transformation1 = transformation1.toOptions();
}
const newTransformation = new cloudinary.Transformation(transformation1);
return newTransformation.fromOptions(transformation2);
};