Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
lines () {
const content = this._content
const defaultPadding = { left: ' ', right: ' ' }
if (content) {
/* string content */
if (t.isString(content)) {
const table = new Table({ column: chalkFormat(content) }, {
padding: defaultPadding,
maxWidth: 80
})
return table.renderLines()
/* array of strings */
} else if (Array.isArray(content) && content.every(t.isString)) {
const rows = content.map(string => ({ column: chalkFormat(string) }))
const table = new Table(rows, {
padding: defaultPadding,
maxWidth: 80
})
return table.renderLines()
/* array of objects (use table-layout) */
var hasValue = data.some(function (row) {
var value = row[columnName];
return t.isDefined(value) && !t.isString(value) || t.isString(value) && /\S+/.test(value);
});
return !hasValue;
value: function cliView(data) {
if (t.isString(data) || !t.isDefined(data)) {
return data;
} else {
return require('util').inspect(data, { depth: 13, colors: true });
}
}
}]);
value: function lines() {
var content = this._content;
var defaultPadding = { left: ' ', right: ' ' };
if (content) {
if (t.isString(content)) {
var table = new Table({ column: ansi.format(content) }, {
padding: defaultPadding,
maxWidth: 80
});
return table.renderLines();
} else if (Array.isArray(content) && content.every(t.isString)) {
var rows = content.map(function (string) {
return { column: ansi.format(string) };
});
var _table = new Table(rows, {
padding: defaultPadding,
maxWidth: 80
});
return _table.renderLines();
} else if (Array.isArray(content) && content.every(t.isPlainObject)) {
var _table2 = new Table(content.map(function (row) {
cliView (data) {
if (t.isString(data) || !t.isDefined(data)) {
return data
} else {
return require('util').inspect(data, { depth: 13, colors: true })
}
}
}