How to use the cloudinary-core.Transformation.methods function in cloudinary-core

To help you get started, we’ve selected a few cloudinary-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cloudinary / cloudinary-vue / src / helpers / attributes.js View on Github external
import { Transformation, Util, Configuration } from "cloudinary-core";
import { formatObject, compact, pick, omit } from "../utils";

/** List of all configuration fields as they are needed in components attributes */
export const configuration = Configuration.CONFIG_PARAMS.map(Util.camelCase);

/** List of all transformation fields as they are needed in components attributes */
export const transformation = Transformation.methods;

/** Extract configuration options for provided object */
export function normalizeConfiguration(cfg) {
  return Util.withSnakeCaseKeys(
    formatObject(compact(pick(cfg, configuration)), {
      secure: v => (typeof v === "boolean" ? v : v === "true")
    })
  );
}

/** Extract transformation options for provided object */
export function normalizeTransformation(cfg) {
  return Util.withSnakeCaseKeys(compact(pick(cfg, transformation)));
}

/** Extract fields that are not used for configuration nor transformation in provided object */