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

html-to-vdom

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-to-vdom - npm Package Compare versions

Comparing version 0.5.5 to 0.6.0

12

lib/html-to-vdom.js

@@ -16,10 +16,14 @@ var createConverter = require('./htmlparser-to-vdom');

var convertedHTML;
if (tags.length > 1) {
throw new Error('Input must always have only one root node. You cannot convert multiple siblings without a wrapping tag around them.');
convertedHTML = tags.map(function (tag) {
return htmlparserToVdom.convert(tag, getVNodeKey);
});
}
var convertedHTML = htmlparserToVdom.convert(tags[0], getVNodeKey);
else {
convertedHTML = htmlparserToVdom.convert(tags[0], getVNodeKey);
}
return convertedHTML;
};
};
{
"name": "html-to-vdom",
"version": "0.5.5",
"version": "0.6.0",
"description": "Converts html into a vtree",

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

@@ -13,2 +13,4 @@ html-to-vdom [![Build Status](https://travis-ci.org/TimBeyer/html-to-vdom.svg?branch=master)](https://travis-ci.org/TimBeyer/html-to-vdom)

As of v0.6.0, converting sibling nodes without an enclosing parent tag returns an array of type `VNode` instead of throwing an error
As of v0.5.1, `html-to-vdom` no longer supports browsers without a full ES5 implementation.

@@ -15,0 +17,0 @@

@@ -21,6 +21,9 @@ var VNode = require('virtual-dom/vnode/vnode');

describe('when converting multiple sibling nodes without a wrapper', function () {
it('throws', function () {
var html = ' <div></div>';
it('returns an array of vnodes', function () {
var html = '<div id="foo"></div><div id="bar"></div>';
should.throw(convertHTML.bind(null, html), 'Input must always have only one root node. You cannot convert multiple siblings without a wrapping tag around them.');
var converted = convertHTML(html);
converted.should.be.an('array');
converted[0].properties.id.should.equal('foo');
converted[1].properties.id.should.equal('foo');
});

@@ -27,0 +30,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