* 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)
| 8 | * @returns {string} A string representation of the arrays. |
| 9 | */ |
| 10 | function 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 | |
| 18 | module.exports = encodeDoubleArray; |
no test coverage detected