(iterable)
| 27 | * @returns {string} joined with comma |
| 28 | */ |
| 29 | const joinIterableWithComma = (iterable) => { |
| 30 | // This is more performant than Array.from().join(", ") |
| 31 | // as it doesn't create an array |
| 32 | let str = ""; |
| 33 | let first = true; |
| 34 | for (const item of iterable) { |
| 35 | if (first) { |
| 36 | first = false; |
| 37 | } else { |
| 38 | str += ", "; |
| 39 | } |
| 40 | str += item; |
| 41 | } |
| 42 | return str; |
| 43 | }; |
| 44 | |
| 45 | /** |
| 46 | * Print exports info to source. |