MCPcopy Create free account
hub / github.com/GNOME/gjs / formatArray

Function formatArray

modules/script/_bootstrap/default.js:127–136  ·  view source on GitHub ↗
(arr, properties, printedObjects)

Source from the content-addressed store, hash-verified

125 }
126
127 function formatArray(arr, properties, printedObjects) {
128 const formattedArray = [];
129 for (const [key, value] of arr.entries()) {
130 if (printedObjects.has(value))
131 formattedArray[key] = '[Circular]';
132 else
133 formattedArray[key] = prettyPrint(value, properties?.children[key]);
134 }
135 return `[${formattedArray.join(', ')}]`;
136 }
137
138 function formatDate(date) {
139 return date.toISOString();

Callers 1

formatObjectFunction · 0.85

Calls 1

prettyPrintFunction · 0.85

Tested by

no test coverage detected