Socket
Socket
Sign inDemoInstall

snabbdom

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snabbdom - npm Package Compare versions

Comparing version 0.5.2 to 0.5.3

2

package.json
{
"name": "snabbdom",
"version": "0.5.2",
"version": "0.5.3",
"description": "A virtual DOM library with focus on simplicity, modularity, powerful features and performance.",

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

@@ -42,3 +42,5 @@ // jshint newcap: false

function emptyNodeAt(elm) {
return VNode(api.tagName(elm).toLowerCase(), {}, [], undefined, elm);
var id = elm.id ? '#' + elm.id : '';
var c = elm.className ? '.' + elm.className.split(' ').join('.') : '';
return VNode(api.tagName(elm).toLowerCase() + id + c, {}, [], undefined, elm);
}

@@ -45,0 +47,0 @@

@@ -139,2 +139,13 @@ var assert = require('assert');

});
it('is a patch of the root element', function () {
var elmWithIdAndClass = document.createElement('div');
elmWithIdAndClass.id = 'id';
elmWithIdAndClass.className = 'class';
var vnode1 = h('div#id.class', [h('span', 'Hi')]);
elm = patch(elmWithIdAndClass, vnode1).elm;
assert.strictEqual(elm, elmWithIdAndClass);
assert.equal(elm.tagName, 'DIV');
assert.equal(elm.id, 'id');
assert.equal(elm.className, 'class');
});
});

@@ -674,3 +685,3 @@ describe('pathing an element', function() {

var vnode1 = h('div', [h('a', {hook: {remove: function(_, rm) { rm3 = rm; }}})]);
var vnode2 = h('div', []);
var vnode2 = h('div', []);
elm = patch(vnode0, vnode1).elm;

@@ -691,3 +702,3 @@ assert.equal(elm.children.length, 1);

var vnode0 = document.createElement('div');
parent.appendChild(vnode0);
parent.appendChild(vnode0);
function cb(vnode, rm) {

@@ -731,3 +742,3 @@ result.push(vnode);

]);
var vnode2 = h('div');
var vnode2 = h('div');
patch(vnode0, vnode1);

@@ -759,3 +770,3 @@ patch(vnode1, vnode2);

]);
var vnode2 = h('div');
var vnode2 = h('div');
patch(vnode0, vnode1);

@@ -778,3 +789,3 @@ patch(vnode1, vnode2);

]);
var vnode2 = h('div');
var vnode2 = h('div');
patch(vnode0, vnode1);

@@ -799,3 +810,3 @@ patch(vnode1, vnode2);

]);
var vnode2 = h('div');
var vnode2 = h('div');
patch(vnode0, vnode1);

@@ -802,0 +813,0 @@ patch(vnode1, vnode2);

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