@live-change/dao
Advanced tools
Comparing version 0.9.30 to 0.9.31
@@ -63,3 +63,3 @@ import Observable from "./Observable.js" | ||
for(i = 0, l = this.list.length; i < l; i++) { | ||
if(this.list[i][field] == value) { | ||
if(this.list[i][field] === value) { | ||
oldElement = this.list[i] | ||
@@ -73,7 +73,7 @@ this.list.splice(i, 1, element) | ||
} | ||
if(i == l) this.list.push(element) | ||
if(i === l) this.list.push(element) | ||
} else { | ||
let i | ||
for(i = this.list.length - 1; i >= 0; i--) { | ||
if(this.list[i][field] == value) { | ||
if(this.list[i][field] === value) { | ||
oldElement = this.list[i] | ||
@@ -95,3 +95,3 @@ this.list.splice(i, 1, element) | ||
for(let i = 0, l = this.list.length; i < l; i++) { | ||
if(JSON.stringify(this.list[i]) == json) this.list.splice(i, 1) | ||
if(JSON.stringify(this.list[i]) === json) this.list.splice(i, 1) | ||
} | ||
@@ -104,3 +104,3 @@ this.fireObservers('remove', exact) | ||
for(let i = 0, l = this.list.length; i < l; i++) { | ||
if(JSON.stringify(this.list[i][field]) == json) { | ||
if(JSON.stringify(this.list[i][field]) === json) { | ||
oldElement = this.list[i] | ||
@@ -123,3 +123,3 @@ this.list.splice(i, 1) | ||
for(let [key, json] of jsonf) { | ||
found = found && (JSON.stringify(this.list[i][key]) == json) | ||
found = found && (JSON.stringify(this.list[i][key]) === json) | ||
} | ||
@@ -139,3 +139,3 @@ if(found) { | ||
for(let i = 0, l = this.list.length; i < l; i++) { | ||
if(JSON.stringify(this.list[i]) == json) this.list.splice(i, 1, element) | ||
if(JSON.stringify(this.list[i]) === json) this.list.splice(i, 1, element) | ||
} | ||
@@ -148,3 +148,3 @@ this.fireObservers('update', exact, element) | ||
for(let i = 0, l = this.list.length; i < l; i++) { | ||
if(JSON.stringify(this.list[i][field]) == json) this.list.splice(i, 1, element) | ||
if(JSON.stringify(this.list[i][field]) === json) this.list.splice(i, 1, element) | ||
} | ||
@@ -162,3 +162,3 @@ this.fireObservers('updateByField', field, value, element) | ||
for(let [key, json] of jsonf) { | ||
found = found && (JSON.stringify(this.list[i][key]) == json) | ||
found = found && (JSON.stringify(this.list[i][key]) === json) | ||
} | ||
@@ -165,0 +165,0 @@ if(found) this.list.splice(i, 1, element) |
@@ -295,3 +295,3 @@ import EventEmitter from './EventEmitter.js' | ||
observationInfo.observation.unpush() | ||
this.remove(what) | ||
if(!this.disposed) this.remove(what) | ||
} | ||
@@ -298,0 +298,0 @@ } |
@@ -38,4 +38,4 @@ { | ||
}, | ||
"version": "0.9.30", | ||
"gitHead": "dc063de0998d29acb7c7d5e2032ed63be8895a8e" | ||
"version": "0.9.31", | ||
"gitHead": "4e12be9d3f339492bb9ddc3c6c77581e52d1ba60" | ||
} |
173051