electrum-store
Advanced tools
Comparing version 1.10.0 to 1.11.0
@@ -167,3 +167,5 @@ 'use strict'; | ||
const value = obj[key]; | ||
if (typeof value === 'object') { | ||
if (value === null) { | ||
this.select(id).set(key, null); | ||
} else if (typeof value === 'object') { | ||
this.apply(_state2.default.join(id, key), value); | ||
@@ -170,0 +172,0 @@ } else { |
{ | ||
"name": "electrum-store", | ||
"version": "1.10.0", | ||
"version": "1.11.0", | ||
"description": "Electrum store provides a store implementation tailored for Electrum.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -89,2 +89,10 @@ 'use strict'; | ||
it ('accepts null values', () => { | ||
const store = Store.create (); | ||
const pojo = {x: 1, y: null}; | ||
store.apply ('a', pojo); | ||
expect (store.select ('a').get ('x')).to.equal (1); | ||
expect (store.select ('a').get ('y')).to.be.null (); | ||
}); | ||
it ('does not mutate store if nothing changes', () => { | ||
@@ -91,0 +99,0 @@ const store = Store.create (); |
@@ -149,3 +149,7 @@ 'use strict'; | ||
const value = obj[key]; | ||
if (typeof value === 'object') { | ||
if (value === null) { | ||
this | ||
.select (id) | ||
.set (key, null); | ||
} else if (typeof value === 'object') { | ||
this.apply (State.join (id, key), value); | ||
@@ -152,0 +156,0 @@ } else { |
88610
2036