MCPcopy
hub / github.com/webpack/webpack / joinIterableWithComma

Function joinIterableWithComma

lib/ModuleInfoHeaderPlugin.js:29–43  ·  view source on GitHub ↗
(iterable)

Source from the content-addressed store, hash-verified

27 * @returns {string} joined with comma
28 */
29const 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.

Callers 1

applyMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected