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

Function toArray

lib/utils/parsing/toArray.js:8–17  ·  view source on GitHub ↗

* @desc Turns arguments that aren't arrays into arrays * @param arg * @returns { any | any[] }

(arg)

Source from the content-addressed store, hash-verified

6 * @returns { any | any[] }
7 */
8function toArray(arg) {
9 switch (true) {
10 case arg == null:
11 return [];
12 case isArray(arg):
13 return arg;
14 default:
15 return [arg];
16 }
17}
18
19module.exports = toArray;

Callers 6

build_upload_paramsFunction · 0.85
build_eagerFunction · 0.85
archive_paramsFunction · 0.85
encodeDoubleArrayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected