Skip to content

Commit fe300df

Browse files
committed
fix closure es5/umd toString() iterator
1 parent 3d5240a commit fe300df

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

js/src/table.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -296,15 +296,15 @@ export class TableToStringIterator implements IterableIterator<string> {
296296
pipe(stream: NodeJS.WritableStream) {
297297
let res: IteratorResult<string>;
298298
let write = () => {
299-
if (stream.writable) {
299+
if (stream['writable']) {
300300
do {
301301
if ((res = this.next()).done) { break; }
302-
} while (stream.write(res.value + '\n', 'utf8'));
302+
} while (stream['write'](res.value + '\n', 'utf8'));
303303
}
304304
if (!res || !res.done) {
305-
stream.once('drain', write);
306-
} else if (!(stream as any).isTTY) {
307-
stream.end('\n');
305+
stream['once']('drain', write);
306+
} else if (!(stream as any)['isTTY']) {
307+
stream['end']('\n');
308308
}
309309
};
310310
write();
@@ -324,7 +324,7 @@ function* tableRowsToString(table: Table, separator = ' | ') {
324324
}
325325
}
326326
yield header.map((x, j) => leftPad(x, ' ', maxColumnWidths[j])).join(separator);
327-
for (let i = -1, n = table.length; ++i < n;) {
327+
for (let i = -1; ++i < table.length;) {
328328
yield [i, ...table.get(i)]
329329
.map((x) => stringify(x))
330330
.map((x, j) => leftPad(x, ' ', maxColumnWidths[j]))

0 commit comments

Comments
 (0)