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

terminal-table

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

terminal-table - npm Package Compare versions

Comparing version 0.0.11 to 0.0.12

test/attr.js

38

index.js

@@ -203,6 +203,23 @@ var eaw = require("eastasianwidth");

Table.prototype.getRange = function(row, column, attr){
for(var i = this.attrMap.length, m;i--;){
for(var i = this.attrMap.length, m, s;i--;){
m = this.attrMap[i];
var r = ((m.row[0] || 0) <= row && row < (m.row[1] || Infinity)) ? 1 : 0;
var c = ((m.column[0] || 0) <= column && column < (m.column[1] || Infinity)) ? 1 : 0;
var startRow = m.row[0] < 0 ? this.table.length + m.row[0] : m.row[0];
var endRow = m.row[1] < 0 ? this.table.length + m.row[1] : m.row[1];
if(startRow > endRow){
s = startRow;
startRow = endRow;
endRow = s;
}
var startCol = m.column[0] < 0 ? this.horlen() + m.column[0] : m.column[0];
var endCol = m.column[1] < 0 ? this.horlen() + m.column[1] : m.column[1];
if(startCol > endCol){
s = startCol;
startCol = endCol;
endRow = s;
}
var r = ((startRow || 0) <= row && row < (endRow || Infinity)) ? 1 : 0;
var c = ((startCol || 0) <= column && column < (endCol || Infinity)) ? 1 : 0;
if((r & c) && m.attr[attr]){

@@ -218,6 +235,3 @@ return m.attr[attr];

var val = null;
if(!this.table[row] || !this.table[row][column]){
return null;
}
if(val = this.table[row][column][attr] || null){
if(this.table[row] && this.table[row][column] && (val = this.table[row][column][attr] || null)){
return val;

@@ -342,2 +356,12 @@ }

Table.prototype.__defineGetter__("cols", function(){
return this.horlen();
});
Table.prototype.__defineGetter__("rows", function(){
return this.table.length;
});
module.exports = Table;

2

package.json
{
"name": "terminal-table",
"version": "0.0.11",
"version": "0.0.12",
"description": "View a table in the terminal.",

@@ -5,0 +5,0 @@ "main": "index.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