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

Function encodeDoubleArray

lib/utils/encoding/encodeDoubleArray.js:10–16  ·  view source on GitHub ↗

* Serialize an array of arrays into a string * @param {string[] | Array. >} array - An array of arrays. * If the first element is not an array the argument is wrapped in an array. * @returns {string} A string representation of the arrays.

(array)

Source from the content-addressed store, hash-verified

8 * @returns {string} A string representation of the arrays.
9 */
10function encodeDoubleArray(array) {
11 array = toArray(array);
12 if (!isArray(array[0])) {
13 array = [array];
14 }
15 return array.map(e => toArray(e).join(",")).join("|");
16}
17
18module.exports = encodeDoubleArray;

Callers 1

Calls 1

toArrayFunction · 0.85

Tested by

no test coverage detected