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

html-to-xlsx

Package Overview
Dependencies
Maintainers
2
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-to-xlsx - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

26

lib/tableToXlsx.js

@@ -83,2 +83,5 @@ const path = require('path')

// xlsxColumnIdx is global column index in table
let xlsxColumnIdx = 0;
for (let cIdx = 0; cIdx < row.length; cIdx++) {

@@ -112,4 +115,4 @@ const cellInfo = row[cIdx]

if (cellInfo.width) {
if (!maxWidths[cIdx]) {
maxWidths[cIdx] = 0 // default width
if (!maxWidths[xlsxColumnIdx]) {
maxWidths[xlsxColumnIdx] = 0 // default width
}

@@ -119,11 +122,20 @@

if (pt > maxWidths[cIdx]) {
if (pt > maxWidths[xlsxColumnIdx]) {
const width = pt / cellSpan
maxWidths[cIdx] = width
// we need to set column width before row commit in order
// to make it work
sheet.getColumn(cIdx + 1).width = width
// only remember max column widths for single columns
if (cellSpan == 1) {
maxWidths[xlsxColumnIdx] = width
// we need to set column width before row commit in order
// to make it work
sheet.getColumn(xlsxColumnIdx + 1).width = width
} else if (!Boolean(sheet.getColumn(xlsxColumnIdx + 1).width)) {
// only set width on multi colspan if not already defined
sheet.getColumn(xlsxColumnIdx + 1).width = width
}
}
}
// increment global column index by cellSpan to track setting of column width
xlsxColumnIdx += cellSpan;
const cell = sheet.getCell(`${context.currentRowInFile + 1}`, `${currentCellOffsetsPerRow[context.currentRowInFile] + 1}`)

@@ -130,0 +142,0 @@

{
"name": "html-to-xlsx",
"version": "2.0.1",
"version": "2.0.2",
"author": {

@@ -5,0 +5,0 @@ "name": "Jan Blaha",

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