Skip to content

Commit

Permalink
Removing setIndexValue()
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed Mar 30, 2017
1 parent ffaaec5 commit ad6c6f0
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 40 deletions.
24 changes: 11 additions & 13 deletions lib/haro.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @author Jason Mulligan <jason.mulligan@avoidwork.com>
* @copyright 2017
* @license BSD-3-Clause
* @version 3.4.2
* @version 3.4.3
*/
"use strict";

Expand Down Expand Up @@ -281,20 +281,19 @@
return ((Math.random() + 1) * 0x10000 | 0).toString(16).substring(1);
}

function setIndexValue (index, key, value) {
if (!index.has(key)) {
index.set(key, new Set());
}

index.get(key).add(value);
}

function setIndex (index, indexes, delimiter, key, data, indice, pattern) {
each(!indice ? index : [indice], i => {
let lidx = keyIndex(i, data, delimiter, pattern);
let lidx = keyIndex(i, data, delimiter, pattern),
lindex;

if (lidx !== undefined && lidx !== null) {
setIndexValue(indexes.get(i), lidx, key);
lindex = indexes.get(i);

if (!lindex.has(lidx)) {
lindex.set(lidx, new Set());
}

lindex.get(lidx).add(key);
}
});
}
Expand Down Expand Up @@ -1116,7 +1115,6 @@
iterate.toString(),
joinData.toString(),
keyIndex.toString(),
setIndexValue.toString(),
setIndex.toString(),
(!node ? "" : "self.") + "onmessage = " + onmessage.toString() + ";"
];
Expand All @@ -1132,7 +1130,7 @@
}

factory.transform = cast;
factory.version = "3.4.2";
factory.version = "3.4.3";

// Node, AMD & window supported
if (typeof exports !== "undefined") {
Expand Down
25 changes: 12 additions & 13 deletions lib/haro.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @author Jason Mulligan <jason.mulligan@avoidwork.com>
* @copyright 2017
* @license BSD-3-Clause
* @version 3.4.2
* @version 3.4.3
*/
"use strict";

Expand Down Expand Up @@ -319,20 +319,19 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
return ((Math.random() + 1) * 0x10000 | 0).toString(16).substring(1);
}

function setIndexValue(index, key, value) {
if (!index.has(key)) {
index.set(key, new Set());
}

index.get(key).add(value);
}

function setIndex(index, indexes, delimiter, key, data, indice, pattern) {
each(!indice ? index : [indice], function (i) {
var lidx = keyIndex(i, data, delimiter, pattern);
var lidx = keyIndex(i, data, delimiter, pattern),
lindex = void 0;

if (lidx !== undefined && lidx !== null) {
setIndexValue(indexes.get(i), lidx, key);
lindex = indexes.get(i);

if (!lindex.has(lidx)) {
lindex.set(lidx, new Set());
}

lindex.get(lidx).add(key);
}
});
}
Expand Down Expand Up @@ -1407,7 +1406,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var functions = void 0;

if (webWorker) {
functions = [cast.toString(), clone.toString(), createIndexes.toString(), each.toString(), has.toString(), iterate.toString(), joinData.toString(), keyIndex.toString(), setIndexValue.toString(), setIndex.toString(), (!node ? "" : "self.") + "onmessage = " + onmessage.toString() + ";"];
functions = [cast.toString(), clone.toString(), createIndexes.toString(), each.toString(), has.toString(), iterate.toString(), joinData.toString(), keyIndex.toString(), setIndex.toString(), (!node ? "" : "self.") + "onmessage = " + onmessage.toString() + ";"];

obj.worker = !node ? global.URL.createObjectURL(blob(functions.join("\n"))) : new Function(functions.join("\n"));
}
Expand All @@ -1420,7 +1419,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
}

factory.transform = cast;
factory.version = "3.4.2";
factory.version = "3.4.3";

// 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": "3.4.2",
"version": "3.4.3",
"description": "Harō is a modern immutable DataStore",
"main": "lib/haro.es6.js",
"scripts": {
Expand Down
1 change: 0 additions & 1 deletion src/factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
iterate.toString(),
joinData.toString(),
keyIndex.toString(),
setIndexValue.toString(),
setIndex.toString(),
(!node ? "" : "self.") + "onmessage = " + onmessage.toString() + ";"
];
Expand Down
19 changes: 9 additions & 10 deletions src/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,20 +255,19 @@
return ((Math.random() + 1) * 0x10000 | 0).toString(16).substring(1);
}

function setIndexValue (index, key, value) {
if (!index.has(key)) {
index.set(key, new Set());
}

index.get(key).add(value);
}

function setIndex (index, indexes, delimiter, key, data, indice, pattern) {
each(!indice ? index : [indice], i => {
let lidx = keyIndex(i, data, delimiter, pattern);
let lidx = keyIndex(i, data, delimiter, pattern),
lindex;

if (lidx !== undefined && lidx !== null) {
setIndexValue(indexes.get(i), lidx, key);
lindex = indexes.get(i);

if (!lindex.has(lidx)) {
lindex.set(lidx, new Set());
}

lindex.get(lidx).add(key);
}
});
}
Expand Down

0 comments on commit ad6c6f0

Please sign in to comment.