Skip to content

Commit 6358975

Browse files
authored
fix falsey return statement (#138)
* fix falsey return statement * remove console.log * fix typo
1 parent 9d6b0a3 commit 6358975

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/core/viewbasedjsonmodel.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,9 @@ export class ViewBasedJSONModel extends MutableDataModel {
276276

277277
const indices: number[] = view.dataset.map((val, i) => {
278278
const lookupVal = JSON.stringify(primaryKey.map(key => val[key]));
279-
return this._primaryKeyMap.get(lookupVal) || i;
279+
const retrievedVal = this._primaryKeyMap.get(lookupVal);
280+
281+
return typeof retrievedVal === "undefined" ? i : retrievedVal;
280282
});
281283

282284
this.dataSync.emit({

0 commit comments

Comments
 (0)