You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

nanomorph

Package Overview
Dependencies
Maintainers
26
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nanomorph - npm Package Compare versions

Comparing version

to
6.0.0-beta1

CHANGELOG.md

10

index.js

@@ -7,2 +7,6 @@ var assert = require('assert')

function isProxy (node) {
return node && node.dataset && node.dataset.proxy !== undefined
}
module.exports = nanomorph

@@ -137,3 +141,7 @@

} else {
oldNode.insertBefore(newChild, oldChild)
if (isProxy(newChild) && !newChild.isSameNode(oldChild) && newChild.realNode) {
oldNode.insertBefore(newChild.realNode, oldChild)
} else {
oldNode.insertBefore(newChild, oldChild)
}
offset++

@@ -140,0 +148,0 @@ }

13

package.json
{
"name": "nanomorph",
"version": "5.1.3",
"version": "6.0.0-beta1",
"description": "Hyper fast diffing algorithm for real DOM nodes",

@@ -10,2 +10,3 @@ "main": "index.js",

"test:fast": "browserify test/diff.js | tape-run",
"test:proxy": "browserify test/proxy.js | tape-run",
"start": "bankai start --debug test/diff.js"

@@ -31,11 +32,11 @@ },

"devDependencies": {
"bankai": "^7.6.2",
"bel": "^5.1.1",
"browserify": "^14.1.0",
"bankai": "^9.8.0",
"bel": "^5.1.7",
"browserify": "^16.1.0",
"dependency-check": "^2.5.1",
"math-random-seed": "^1.0.0",
"standard": "^10.0.3",
"tape": "^4.6.0",
"tape-run": "^3.0.0"
"tape": "^4.9.0",
"tape-run": "^3.0.4"
}
}

@@ -92,29 +92,2 @@ var tape = require('tape')

t.test('events', function (t) {
t.test('should copy onclick events', function (t) {
t.plan(1)
var a = html`<button onclick=${fail}>OLD</button>`
var b = html`<button>NEW</button>`
var res = morph(a, b)
res.click()
a = html`<button>OLD</button>`
b = html`<button onclick=${pass}>NEW</button>`
res = morph(a, b)
res.click()
function fail (e) {
e.preventDefault()
t.fail('should not be called')
}
function pass (e) {
e.preventDefault()
t.ok('called')
}
})
})
t.test('values', function (t) {

@@ -121,0 +94,0 @@ t.test('if new tree has no value and old tree does, remove value', function (t) {

@@ -5,2 +5,3 @@ var tape = require('tape')

var nanomorph = require('../')
var abstractMorphEvents = require('./events')

@@ -11,2 +12,3 @@ if (!module.parent) {

abstractMorph(nanomorph)
abstractMorphEvents(nanomorph)
} else {

@@ -13,0 +15,0 @@ module.exports = abstractMorph