Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cli-ux

Package Overview
Dependencies
Maintainers
6
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cli-ux - npm Package Compare versions

Comparing version 5.3.2 to 5.3.3

19

lib/styled/table.js

@@ -109,9 +109,20 @@ "use strict";

}
getCSVRow(d) {
const values = this.columns.map(col => d[col.key] || '');
const needToBeEscapedForCsv = (e) => {
// CSV entries containing line breaks, comma or double quotes
// as specified in https://tools.ietf.org/html/rfc4180#section-2
return e.includes('"') || e.includes('\n') || e.includes('\r\n') || e.includes('\r') || e.includes(',');
};
const lineToBeEscaped = values.find(needToBeEscapedForCsv);
return values.map(e => lineToBeEscaped ? `"${e.replace('"', '""')}"` : e);
}
outputCSV() {
// tslint:disable-next-line:no-this-assignment
const { data, columns, options } = this;
options.printLine(columns.map(c => c.header).join(','));
if (!options['no-header']) {
options.printLine(columns.map(c => c.header).join(','));
}
data.forEach((d) => {
let row = [];
columns.forEach(col => row.push(d[col.key] || ''));
const row = this.getCSVRow(d);
options.printLine(row.join(','));

@@ -235,3 +246,3 @@ });

filter: command_1.flags.string({ description: 'filter property by partial string matching, ex: name=foo' }),
csv: command_1.flags.boolean({ exclusive: ['no-truncate', 'no-header'], description: 'output is csv format' }),
csv: command_1.flags.boolean({ exclusive: ['no-truncate'], description: 'output is csv format' }),
extended: command_1.flags.boolean({ exclusive: ['columns'], char: 'x', description: 'show extra columns' }),

@@ -238,0 +249,0 @@ 'no-truncate': command_1.flags.boolean({ exclusive: ['csv'], description: 'do not truncate output to fit screen' }),

{
"name": "cli-ux",
"description": "cli IO utilities",
"version": "5.3.2",
"version": "5.3.3",
"author": "Jeff Dickey @jdxcode",

@@ -6,0 +6,0 @@ "bugs": "https://github.com/oclif/cli-ux/issues",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc