MCPcopy Create free account
hub / github.com/cloudinary/cloudinary_npm / process_custom_function

Function process_custom_function

lib/utils/index.js:170–180  ·  view source on GitHub ↗

* Parse custom_function options * @private * @param {object|*} customFunction a custom function object containing function_type and source values * @return {string|*} custom_function transformation string

(customFunction)

Source from the content-addressed store, hash-verified

168 * @return {string|*} custom_function transformation string
169 */
170function process_custom_function(customFunction) {
171 if (!isObject(customFunction)) {
172 return customFunction;
173 }
174 if (customFunction.function_type === "remote") {
175 const encodedSource = base64EncodeURL(customFunction.source);
176
177 return [customFunction.function_type, encodedSource].join(":");
178 }
179 return [customFunction.function_type, customFunction.source].join(":");
180}
181
182/**
183 * Parse custom_pre_function options

Callers 2

Calls 1

base64EncodeURLFunction · 0.85

Tested by

no test coverage detected