Fix console.table display of Map and move tests to unit test (#1839)

This commit is contained in:
Kevin (Kun) "Kassimo" Qian 2019-02-25 16:11:54 -08:00 committed by Ryan Dahl
parent ce5d5c5133
commit c66d043ac6
11 changed files with 281 additions and 152 deletions

View file

@ -581,8 +581,8 @@ export class Console {
table = (data: unknown, properties?: string[]): void => {
if (properties !== undefined && !Array.isArray(properties)) {
throw new Error(
"The 'properties' argument must be of type Array\
. Received type string"
"The 'properties' argument must be of type Array. " +
"Received type string"
);
}
@ -615,7 +615,7 @@ export class Console {
let idx = 0;
resultData = {};
data.forEach((k: unknown, v: unknown) => {
data.forEach((v: unknown, k: unknown) => {
resultData[idx] = { Key: k, Values: v };
idx++;
});