inquirer-plugins 1.0.0-alpha.1 → 1.0.0-alpha.2
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.
|
@@ -48,10 +48,9 @@ export class TableClass {
|
|
|
48
48
|
for (let i = 0; i < this.rows.length; i++) {
|
|
49
49
|
result.push({});
|
|
50
50
|
for (let ii = 0; ii < (this.rows[i] || []).length; ii++) {
|
|
51
|
-
const {
|
|
52
|
-
const name = trim(n.toString());
|
|
51
|
+
const { value: key, type, parser } = this.columns[ii];
|
|
53
52
|
const value = trim(this.rows[i][ii]);
|
|
54
|
-
result[i][
|
|
53
|
+
result[i][key] = parser ? parser(value) : parse(value, type);
|
|
55
54
|
}
|
|
56
55
|
}
|
|
57
56
|
return result;
|
package/package.json
CHANGED
|
@@ -57,10 +57,9 @@ export class TableClass {
|
|
|
57
57
|
for (let i = 0; i < this.rows.length; i++) {
|
|
58
58
|
result.push({})
|
|
59
59
|
for (let ii = 0; ii < (this.rows[i] || []).length; ii++) {
|
|
60
|
-
const {
|
|
61
|
-
const name = trim(n.toString())
|
|
60
|
+
const { value: key, type, parser } = this.columns[ii]
|
|
62
61
|
const value = trim(this.rows[i][ii])
|
|
63
|
-
result[i][
|
|
62
|
+
result[i][key] = parser ? parser(value) : parse(value, type)
|
|
64
63
|
}
|
|
65
64
|
}
|
|
66
65
|
return result
|