How to use the cloudinary-core.Configuration.CONFIG_PARAMS 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, normalizeObject, pick, omit, merge } from "../utils";

export const configuration = Configuration.CONFIG_PARAMS.map(Util.camelCase);
export const transformation = Transformation.PARAM_NAMES.map(
  Util.camelCase
).filter(name => configuration.indexOf(name) < 0);

export function normalizeConfiguration(cfg) {
  return Util.withSnakeCaseKeys(
    formatObject(normalizeObject(pick(cfg, configuration)), {
      secure: v => (typeof v === "boolean" ? v : v === "true")
    })
  );
}

export function normalizeTransformation(cfg) {
  return Util.withSnakeCaseKeys(normalizeObject(pick(cfg, transformation)));
}
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)));