@zoodogood/utils 1.0.6-change.700 → 1.0.6-change.712

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,7 +33,6 @@ class TextTableGenerator {
33
33
  if (this.options.borderBottom !== null) {
34
34
  context.content += this.drawBlockBorder(BorderDirectionEnum.BorderBottom);
35
35
  }
36
- console.log(JSON.stringify(this));
37
36
  return context.content;
38
37
  }
39
38
  getColumns() {
@@ -84,10 +83,14 @@ class TextTableGenerator {
84
83
  if (getRowType(row) === SpecialRowTypeEnum.Default) {
85
84
  row = row;
86
85
  content += (_c = (_b = (_a = this.options).borderLeft) === null || _b === void 0 ? void 0 : _b.call(_a, context, context.currentRow)) !== null && _c !== void 0 ? _c : "";
87
- for (const cellIndex in row) {
86
+ console.log(row);
87
+ for (const cellIndex of Object.keys(row)) {
88
88
  const cell = row.at(+cellIndex);
89
+ console.log(cellIndex);
90
+ console.log(cell);
89
91
  const expectedWidth = metadata.columns.at(+cellIndex).largestLength;
90
92
  content += this.drawCell(cell, expectedWidth);
93
+ console.log(content);
91
94
  if (+cellIndex !== row.length - 1) {
92
95
  content += !cell.options.removeNextSeparator
93
96
  ? this.options.separator
@@ -101,6 +104,7 @@ class TextTableGenerator {
101
104
  row = row;
102
105
  content += this.drawLine(row.display);
103
106
  }
107
+ console.log({ content });
104
108
  return content;
105
109
  }
106
110
  drawCell(cell, expectedWidth) {
@@ -123,10 +127,11 @@ class TextTableGenerator {
123
127
  let content = "";
124
128
  const context = this.context;
125
129
  const length = this.calculateTableWidth();
126
- for (const index in [...new Array(length)]) {
130
+ for (const index of [...new Array(length)].map((_, index) => index)) {
127
131
  const symbol = setSymbol(context, +index);
128
132
  content += symbol;
129
133
  }
134
+ console.log({ drawLineContent: content });
130
135
  return content;
131
136
  }
132
137
  drawBlockBorder(borderDirection) {
@@ -260,6 +265,5 @@ class TextTableBuilder {
260
265
  }
261
266
  export { TextTableBuilder };
262
267
  export { SpecialRowTypeEnum, CellAlignEnum, BorderDirectionEnum };
263
- const builder = new TextTableBuilder()
264
- .addRowWithElements(["1", "2", "3"]);
268
+ const builder = new TextTableBuilder().addRowWithElements(["1", "2", "3"]);
265
269
  console.log(builder.generateTextContent());
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zoodogood/utils",
3
3
  "type": "module",
4
- "version": "1.0.6-change.700",
4
+ "version": "1.0.6-change.712",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",