@gabrielrufino/cube 1.0.17 → 1.0.18

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.
@@ -61,13 +61,12 @@ var Queue = /** @class */ (function (_super) {
61
61
  this._data = [];
62
62
  };
63
63
  Queue.prototype[Symbol.toPrimitive] = function (type) {
64
- if (type === 'string') {
65
- return "[Front] ".concat(this.data.join(', '));
66
- }
67
- if (type === 'number') {
68
- return this.size;
69
- }
70
- return null;
64
+ var primitives = {
65
+ default: true,
66
+ number: this.size,
67
+ string: "[Front] ".concat(this.data.join(', ')),
68
+ };
69
+ return primitives[type];
71
70
  };
72
71
  return Queue;
73
72
  }(DataStructure_1.default));
@@ -51,13 +51,12 @@ var Stack = /** @class */ (function (_super) {
51
51
  configurable: true
52
52
  });
53
53
  Stack.prototype[Symbol.toPrimitive] = function (type) {
54
- if (type === 'string') {
55
- return "".concat(this.data.join(', '), " [Top]");
56
- }
57
- if (type === 'number') {
58
- return this.size;
59
- }
60
- return null;
54
+ var primitives = {
55
+ default: true,
56
+ number: this.size,
57
+ string: "".concat(this.data.join(', '), " [Top]"),
58
+ };
59
+ return primitives[type];
61
60
  };
62
61
  return Stack;
63
62
  }(DataStructure_1.default));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gabrielrufino/cube",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "description": "Data Structures and Algorithms made in Typescript",
5
5
  "main": "build/index.js",
6
6
  "scripts": {