MCPcopy Create free account
hub / github.com/EsperoTech/yaade / emitArray

Method emitArray

client/src/utils/jasmine/jasmine.js:7060–7095  ·  view source on GitHub ↗
(array)

Source from the content-addressed store, hash-verified

7058 }
7059
7060 emitArray(array) {
7061 if (this.ppNestLevel_ > j$.MAX_PRETTY_PRINT_DEPTH) {
7062 this.append('Array');
7063 return;
7064 }
7065
7066 const length = Math.min(array.length, j$.MAX_PRETTY_PRINT_ARRAY_LENGTH);
7067 this.append('[ ');
7068
7069 for (let i = 0; i < length; i++) {
7070 if (i > 0) {
7071 this.append(', ');
7072 }
7073 this.format(array[i]);
7074 }
7075 if (array.length > length) {
7076 this.append(', ...');
7077 }
7078
7079 let first = array.length === 0;
7080 const wasTruncated = this.iterateObject(array, (property) => {
7081 if (first) {
7082 first = false;
7083 } else {
7084 this.append(', ');
7085 }
7086
7087 this.formatProperty(array, property);
7088 });
7089
7090 if (wasTruncated) {
7091 this.append(', ...');
7092 }
7093
7094 this.append(' ]');
7095 }
7096
7097 emitSet(set) {
7098 if (this.ppNestLevel_ > j$.MAX_PRETTY_PRINT_DEPTH) {

Callers 1

formatMethod · 0.95

Calls 5

appendMethod · 0.95
formatMethod · 0.95
iterateObjectMethod · 0.95
formatPropertyMethod · 0.95
minMethod · 0.80

Tested by

no test coverage detected