New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dcsv

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dcsv - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

14

built/commands/look.js

@@ -11,14 +11,17 @@ "use strict";

const csv = require('../csv');
const linq = require('../linq');
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = function run([filename, options]) {
return __awaiter(this, void 0, void 0, function* () {
let maxSize = 0;
let maxSizes = [];
let maxLineNumberSize = 1;
yield csv.read(filename, (line, linenumber) => {
const values = csv.parse(line, options.delimiter);
maxSize = linq.max(values, val => val.length);
maxSizes = values.map((val, i) => {
return (maxSizes[i] || -1) > val.length ? maxSizes[i] : val.length;
});
maxLineNumberSize = linenumber;
});
maxLineNumberSize = `${maxLineNumberSize}`.length;
if (options.lineNumbers) {
maxSizes.unshift(`${maxLineNumberSize}`.length);
}
yield csv.read(filename, (line, lineNumber) => {

@@ -30,4 +33,3 @@ const values = csv.parse(line, options.delimiter);

console.log(values.map((val, i) => {
let size = options.lineNumbers && !i ? maxLineNumberSize : maxSize;
const complement = size - val.length;
const complement = maxSizes[i] - val.length;
return ` ${val}${' '.repeat(complement)} `;

@@ -34,0 +36,0 @@ }).join('|'));

{
"name": "dcsv",
"version": "0.0.1",
"version": "0.0.2",
"description": "Do things with csv files.",

@@ -5,0 +5,0 @@ "main": "built/ahgora-service.js",

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