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

snabbdom-virtualize

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snabbdom-virtualize - npm Package Compare versions

Comparing version 0.2.1 to 0.3.0

12

index.js

@@ -93,7 +93,9 @@ (function webpackUniversalModuleDefinition(root, factory) {

// otherwise.
if (el.childNodes.length > 1) {
throw new Error('Cannot virtualize multiple top-level nodes.');
} else if (el.childNodes.length === 1) {
// Pull out the top-level node and run it through the virtualize fn.
return snabbdomVirtualize(el.childNodes.item(0));
var _childNodes = Array.prototype.slice.call(el.childNodes);
if (_childNodes.length === 1) {
return snabbdomVirtualize(_childNodes[0]);
} else {
return _childNodes.map(function (child) {
return snabbdomVirtualize(child);
});
}

@@ -100,0 +102,0 @@ }

{
"name": "snabbdom-virtualize",
"version": "0.2.1",
"version": "0.3.0",
"description": "Library for turning strings and DOM nodes into virtual DOM nodes compatible with snabbdom.",

@@ -43,3 +43,6 @@ "author": {

"snabbdom": "^0.3.0"
},
"dependencies": {
"html-parse-stringify": "^1.0.2"
}
}

@@ -129,6 +129,10 @@ import virtualize from '../../src/index';

it("should throw an error when there's more than one top-level node passed in the string", () => {
expect(() => {
virtualize('<div><h1>Something</h1></div><span>Something more</span>')
}).to.throw('Cannot virtualize multiple top-level nodes.');
it("should handle multiple top-level nodes, returning them as an array", () => {
const actual = virtualize('<div><h1>Something</h1></div><span>Something more</span>');
expect(actual).to.deep.equal([
h('div', [
h('h1', ['Something'])
]),
h('span', ['Something more'])
]);
});

@@ -135,0 +139,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