MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / formatArray

Function formatArray

lib/web/jshint.js:1147–1164  ·  view source on GitHub ↗
(ctx, value, recurseTimes, visibleKeys, keys)

Source from the content-addressed store, hash-verified

1145
1146
1147function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
1148 var output = [];
1149 for (var i = 0, l = value.length; i < l; ++i) {
1150 if (hasOwnProperty(value, String(i))) {
1151 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
1152 String(i), true));
1153 } else {
1154 output.push('');
1155 }
1156 }
1157 keys.forEach(function(key) {
1158 if (!key.match(/^\d+$/)) {
1159 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
1160 key, true));
1161 }
1162 });
1163 return output;
1164}
1165
1166
1167function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {

Callers 1

formatValueFunction · 0.85

Calls 5

hasOwnPropertyFunction · 0.85
formatPropertyFunction · 0.85
pushMethod · 0.45
forEachMethod · 0.45
matchMethod · 0.45

Tested by

no test coverage detected