Skip to content

Commit

Permalink
Fixing a key error in set()
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed Oct 15, 2015
1 parent d926351 commit 19f99af
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 13 deletions.
10 changes: 6 additions & 4 deletions lib/haro.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @copyright 2015
* @license BSD-3-Clause
* @link http://haro.rocks
* @version 1.7.6
* @version 1.7.7
*/
"use strict";

Expand Down Expand Up @@ -804,8 +804,10 @@ class Haro {
};

if (lkey === undefined || lkey === null) {
lkey = null;
} else if (this.data.has(lkey)) {
lkey = ldata[this.key] || null;
}

if (lkey && this.data.has(lkey)) {
method = "put";
ogdata = this.data.get(lkey);

Expand Down Expand Up @@ -1107,7 +1109,7 @@ function factory (data = null, config = {}, indexes = []) {
}

factory.transform = cast;
factory.version = "1.7.6";
factory.version = "1.7.7";

// Node, AMD & window supported
if (typeof exports !== "undefined") {
Expand Down
10 changes: 6 additions & 4 deletions lib/haro.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @copyright 2015
* @license BSD-3-Clause
* @link http://haro.rocks
* @version 1.7.6
* @version 1.7.7
*/
"use strict";

Expand Down Expand Up @@ -898,8 +898,10 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
};

if (lkey === undefined || lkey === null) {
lkey = null;
} else if (this.data.has(lkey)) {
lkey = ldata[this.key] || null;
}

if (lkey && this.data.has(lkey)) {
method = "put";
ogdata = this.data.get(lkey);

Expand Down Expand Up @@ -1239,7 +1241,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
}

factory.transform = cast;
factory.version = "1.7.6";
factory.version = "1.7.7";

// Node, AMD & window supported
if (typeof exports !== "undefined") {
Expand Down
2 changes: 1 addition & 1 deletion lib/haro.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/haro.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "haro",
"version": "1.7.6",
"version": "1.7.7",
"description": "Harō is a modern immutable DataStore using Maps, Sets, Promises, & Tuples",
"main": "lib/haro.js",
"scripts": {
Expand Down
6 changes: 4 additions & 2 deletions src/haro.js
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,10 @@ class Haro {
};

if (lkey === undefined || lkey === null) {
lkey = null;
} else if (this.data.has(lkey)) {
lkey = ldata[this.key] || null;
}

if (lkey && this.data.has(lkey)) {
method = "put";
ogdata = this.data.get(lkey);

Expand Down

0 comments on commit 19f99af

Please sign in to comment.