MCPcopy Index your code
hub / github.com/microsoft/SandDance / formatArrayValue

Function formatArrayValue

docs/app/js/sanddance-app.js:58485–58494  ·  view source on GitHub ↗
(v, opts)

Source from the content-addressed store, hash-verified

58483 return decimal === string.length - 2 ? string.slice(0, -1) : string;
58484}
58485function formatArrayValue(v, opts) {
58486 const { maxElts =16 , size =1 } = opts;
58487 let string = "[";
58488 for(let i = 0; i < v.length && i < maxElts; ++i){
58489 if (i > 0) string += ",".concat(i % size === 0 ? " " : "");
58490 string += formatValue(v[i], opts);
58491 }
58492 const terminator = v.length > maxElts ? "..." : "]";
58493 return "".concat(string).concat(terminator);
58494}
58495function formatImage(image, message, scale) {
58496 let maxWidth = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 600;
58497 const imageUrl = image.src.replace(/\(/g, "%28").replace(/\)/g, "%29");

Callers 1

formatValueFunction · 0.70

Calls 1

formatValueFunction · 0.70

Tested by

no test coverage detected