MCPcopy Create free account
hub / github.com/microsoft/SandDance / formatArray

Function formatArray

docs/tests/v2/es6/js/sanddance.js:8022–8039  ·  view source on GitHub ↗
(ctx, value, recurseTimes, visibleKeys, keys)

Source from the content-addressed store, hash-verified

8020}
8021
8022function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
8023 var output = [];
8024
8025 for (var i = 0, l = value.length; i < l; ++i) {
8026 if (hasOwnProperty(value, String(i))) {
8027 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true));
8028 } else {
8029 output.push('');
8030 }
8031 }
8032
8033 keys.forEach(function (key) {
8034 if (!key.match(/^\d+$/)) {
8035 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true));
8036 }
8037 });
8038 return output;
8039}
8040
8041function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
8042 var name, str, desc;

Callers 3

formatValueFunction · 0.70
formatTooltipFunction · 0.70
formatObjectFunction · 0.70

Calls 3

formatPropertyFunction · 0.85
hasOwnPropertyFunction · 0.70
forEachMethod · 0.45

Tested by

no test coverage detected