@mongez/reinforcements 2.0.2 → 2.0.3

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.
@@ -96,6 +96,10 @@ export default class ImmutableCollection {
96
96
  */
97
97
  divide(amount: number): any;
98
98
  divide(key: string, amount: number): any;
99
+ /**
100
+ * Divide the given key in each element or the element by 2
101
+ */
102
+ half(key?: string): any;
99
103
  /**
100
104
  * Get the modulus of the given amount to each element or given key in each element
101
105
  */
@@ -264,6 +264,12 @@ var ImmutableCollection = /** @class */ (function () {
264
264
  return item / amount;
265
265
  });
266
266
  };
267
+ /**
268
+ * Divide the given key in each element or the element by 2
269
+ */
270
+ ImmutableCollection.prototype.half = function (key) {
271
+ return key ? this.divide(key, 2) : this.divide(2);
272
+ };
267
273
  ImmutableCollection.prototype.modulus = function () {
268
274
  var args = [];
269
275
  for (var _i = 0; _i < arguments.length; _i++) {
@@ -96,6 +96,10 @@ export default class ImmutableCollection {
96
96
  */
97
97
  divide(amount: number): any;
98
98
  divide(key: string, amount: number): any;
99
+ /**
100
+ * Divide the given key in each element or the element by 2
101
+ */
102
+ half(key?: string): any;
99
103
  /**
100
104
  * Get the modulus of the given amount to each element or given key in each element
101
105
  */
@@ -252,6 +252,12 @@ var ImmutableCollection = /** @class */ (function () {
252
252
  return item / amount;
253
253
  });
254
254
  };
255
+ /**
256
+ * Divide the given key in each element or the element by 2
257
+ */
258
+ ImmutableCollection.prototype.half = function (key) {
259
+ return key ? this.divide(key, 2) : this.divide(2);
260
+ };
255
261
  ImmutableCollection.prototype.modulus = function () {
256
262
  var args = [];
257
263
  for (var _i = 0; _i < arguments.length; _i++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mongez/reinforcements",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "A lightweight package to give a massive reinforcements to variant types of data in Nodejs/Javascript",
5
5
  "main": "./cjs/index.js",
6
6
  "dependencies": {