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

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.3.2 to 0.3.3

examples/svg/script.js~

2

modules/props.js

@@ -12,3 +12,3 @@ function updateProps(oldVnode, vnode) {

old = oldProps[key];
if (old !== cur) {
if (old !== cur && (key !== 'value' || elm[key] !== cur)) {
elm[key] = cur;

@@ -15,0 +15,0 @@ }

{
"name": "snabbdom",
"version": "0.3.2",
"version": "0.3.3",
"description": "A virtual DOM library with focus on simplicity, modularity, powerful features and performance.",

@@ -16,6 +16,10 @@ "main": "snabbdom.js",

"knuth-shuffle": "^1.0.1",
"testem": "^1.0.2"
"testem": "^1.0.2",
"xyz": "0.5.x"
},
"scripts": {
"test": "testem"
"test": "testem",
"release-major": "xyz --repo git@github.com:paldepind/snabbdom.git --increment major",
"release-minor": "xyz --repo git@github.com:paldepind/snabbdom.git --increment minor",
"release-patch": "xyz --repo git@github.com:paldepind/snabbdom.git --increment patch"
},

@@ -22,0 +26,0 @@ "repository": {

// jshint newcap: false
/* global require, module, document, Element */
/* global require, module, document, Node */
'use strict';

@@ -198,5 +198,8 @@

} else if (isDef(ch)) {
if (isDef(oldVnode.text)) elm.textContent = '';
addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
} else if (isDef(oldCh)) {
removeVnodes(elm, oldCh, 0, oldCh.length - 1);
} else if (isDef(oldVnode.text)) {
elm.textContent = '';
}

@@ -215,3 +218,3 @@ } else if (oldVnode.text !== vnode.text) {

for (i = 0; i < cbs.pre.length; ++i) cbs.pre[i]();
if (oldVnode.nodeType === Element.ELEMENT_NODE) {
if (oldVnode.nodeType === Node.ELEMENT_NODE) {
if (oldVnode.parentElement !== null) {

@@ -218,0 +221,0 @@ createElm(vnode, insertedVnodeQueue);

@@ -451,2 +451,29 @@ var assert = require('assert');

});
it('removes a single text node', function() {
var vnode1 = h('div', 'One');
var vnode2 = h('div');
patch(vnode0, vnode1);
assert.equal(elm.textContent, 'One');
patch(vnode1, vnode2);
assert.equal(elm.textContent, '');
});
it('removes a single text node when children are updated', function() {
var vnode1 = h('div', 'One');
var vnode2 = h('div', [ h('div', 'Two'), h('span', 'Three') ]);
patch(vnode0, vnode1);
assert.equal(elm.textContent, 'One');
patch(vnode1, vnode2);
console.log(elm.childNodes);
assert.deepEqual(map(prop('textContent'), elm.childNodes), ['Two', 'Three']);
});
it('removes a text node among other elements', function() {
var vnode1 = h('div', [ 'One', h('span', 'Two') ]);
var vnode2 = h('div', [ h('div', 'Three')]);
patch(vnode0, vnode1);
assert.deepEqual(map(prop('textContent'), elm.childNodes), ['One', 'Two']);
patch(vnode1, vnode2);
assert.equal(elm.childNodes.length, 1);
assert.equal(elm.childNodes[0].tagName, 'DIV');
assert.equal(elm.childNodes[0].textContent, 'Three');
});
it('reorders elements', function() {

@@ -453,0 +480,0 @@ var vnode1 = h('div', [h('span', 'One'), h('div', 'Two'), h('b', 'Three')]);

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