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

nanomorph

Package Overview
Dependencies
Maintainers
3
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 5.0.0 to 5.1.0

14

lib/morph.js

@@ -118,8 +118,14 @@ var events = require('./events')

if (!newNode.hasAttributeNS(null, 'value') || newValue === 'null') {
if (newValue !== oldValue) {
oldNode.setAttribute('value', newValue)
oldNode.value = newValue
}
if (newValue === 'null') {
oldNode.value = ''
oldNode.removeAttribute('value')
} else if (newValue !== oldValue) {
oldNode.setAttribute('value', newValue)
oldNode.value = newValue
}
if (!newNode.hasAttributeNS(null, 'value')) {
oldNode.removeAttribute('value')
} else if (oldNode.type === 'range') {

@@ -126,0 +132,0 @@ // this is so elements like slider move their UI thingy

{
"name": "nanomorph",
"version": "5.0.0",
"version": "5.1.0",
"description": "Hyper fast diffing algorithm for real DOM nodes",

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

@@ -152,3 +152,3 @@ var seed = require('math-random-seed')

t.test('if new tree has value and old tree does too, set value from new tree', function (t) {
t.plan(1)
t.plan(4)
var a = html`<input type="text" value="howdy" />`

@@ -158,2 +158,21 @@ var b = html`<input type="text" value="hi" />`

t.equal(res.value, 'hi')
a = html`<input type="text"/>`
a.value = 'howdy'
b = html`<input type="text"/>`
b.value = 'hi'
res = morph(a, b)
t.equal(res.value, 'hi')
a = html`<input type="text" value="howdy"/>`
b = html`<input type="text"/>`
b.value = 'hi'
res = morph(a, b)
t.equal(res.value, 'hi')
a = html`<input type="text"/>`
a.value = 'howdy'
b = html`<input type="text" value="hi"/>`
res = morph(a, b)
t.equal(res.value, 'hi')
})

@@ -160,0 +179,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