@gabrielrufino/cube 2.0.11 → 2.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/HashTable/index.js +5 -1
- package/package.json +5 -5
package/dist/HashTable/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var HashTable = /** @class */ (function () {
|
|
|
15
15
|
function HashTable(inputs, _a) {
|
|
16
16
|
if (inputs === void 0) { inputs = {}; }
|
|
17
17
|
var _b = _a === void 0 ? {} : _a, _c = _b.maxSize, maxSize = _c === void 0 ? 100 : _c;
|
|
18
|
-
this._data =
|
|
18
|
+
this._data = Array.from({ length: maxSize });
|
|
19
19
|
this.maxSize = maxSize;
|
|
20
20
|
for (var _i = 0, _d = Object.entries(inputs); _i < _d.length; _i++) {
|
|
21
21
|
var _e = _d[_i], key = _e[0], value = _e[1];
|
|
@@ -26,6 +26,10 @@ var HashTable = /** @class */ (function () {
|
|
|
26
26
|
get: function () {
|
|
27
27
|
return this._data
|
|
28
28
|
.map(function (value, index) { return ({ index: index, value: value }); })
|
|
29
|
+
.filter(function (_a) {
|
|
30
|
+
var value = _a.value;
|
|
31
|
+
return value !== undefined;
|
|
32
|
+
})
|
|
29
33
|
.reduce(function (accumulator, current) {
|
|
30
34
|
var _a;
|
|
31
35
|
return (__assign(__assign({}, accumulator), (_a = {}, _a[current.index] = current.value, _a)));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gabrielrufino/cube",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.13",
|
|
4
4
|
"description": "Data structures made in Typescript",
|
|
5
5
|
"author": "Gabriel Rufino <contato@gabrielrufino.com>",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
"test:watch": "vitest"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@antfu/eslint-config": "^4.
|
|
32
|
+
"@antfu/eslint-config": "^4.14.1",
|
|
33
33
|
"@commitlint/cli": "^19.8.1",
|
|
34
34
|
"@commitlint/config-conventional": "^19.8.1",
|
|
35
|
-
"@faker-js/faker": "^9.
|
|
35
|
+
"@faker-js/faker": "^9.8.0",
|
|
36
36
|
"@stryker-mutator/vitest-runner": "^8.7.1",
|
|
37
|
-
"@vitest/coverage-v8": "^3.
|
|
38
|
-
"eslint": "^9.
|
|
37
|
+
"@vitest/coverage-v8": "^3.2.3",
|
|
38
|
+
"eslint": "^9.28.0",
|
|
39
39
|
"husky": "^9.1.7",
|
|
40
40
|
"typescript": "^5.8.3",
|
|
41
41
|
"vitest": "^3.0.4"
|