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

@mapbox/hast-util-table-cell-style

Package Overview
Dependencies
Maintainers
230
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mapbox/hast-util-table-cell-style - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

3

.eslintrc.json

@@ -5,3 +5,3 @@ {

"node": true,
"es6": true,
"es6": false,
"jest": true

@@ -11,5 +11,4 @@ },

"rules": {
"node/no-unsupported-features": ["error", {"version": 6}],
"node/no-missing-require": ["error"]
}
}
# Changelog
## 0.1.3
- Use ES5 for browser compatibility.
## 0.1.2

@@ -4,0 +8,0 @@

'use strict';
const visit = require('unist-util-visit');
var visit = require('unist-util-visit');
const hastCssPropertyMap = {
var hasOwnProperty = Object.prototype.hasOwnProperty;
var hastCssPropertyMap = {
align: 'text-align',

@@ -21,22 +22,28 @@ valign: 'vertical-align',

}
Object.keys(hastCssPropertyMap).map(hastName => {
if (node.properties[hastName] === undefined) {
return;
var hastName;
var cssName;
for (hastName in hastCssPropertyMap) {
if (
!hasOwnProperty.call(hastCssPropertyMap, hastName) ||
node.properties[hastName] === undefined
) {
continue;
}
const cssName = hastCssPropertyMap[hastName];
cssName = hastCssPropertyMap[hastName];
appendStyle(node, cssName, node.properties[hastName]);
delete node.properties[hastName];
});
}
}
function appendStyle(node, property, value) {
let prevStyle = (node.properties.style || '').trim();
var prevStyle = (node.properties.style || '').trim();
if (prevStyle && !/;\s*/.test(prevStyle)) {
prevStyle = `${prevStyle};`;
prevStyle += ';';
}
if (prevStyle) {
prevStyle = `${prevStyle} `;
prevStyle += ' ';
}
const nextStyle = `${prevStyle}${property}: ${value};`;
var nextStyle = prevStyle + property + ': ' + value + ';';
node.properties.style = nextStyle;
}
{
"name": "@mapbox/hast-util-table-cell-style",
"version": "0.1.2",
"version": "0.1.3",
"description": "Transform deprecated styling attributes on HAST table cells to inline styles",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -0,1 +1,2 @@

/* eslint-env es6 */
'use strict';

@@ -2,0 +3,0 @@

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