@ejfdelgado/ejflab-common 1.16.9 → 1.16.10
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/package.json +1 -1
- package/src/MyTuples.js +9 -4
package/package.json
CHANGED
package/src/MyTuples.js
CHANGED
|
@@ -4,12 +4,17 @@ const { SimpleObj } = require("./SimpleObj");
|
|
|
4
4
|
const TAMANIO_ALEATORIO = 10;
|
|
5
5
|
const MAX_BUFFER_CHANGES = 50;
|
|
6
6
|
|
|
7
|
+
const compFun = (a, b) => {
|
|
8
|
+
return a.k.length - b.k.length;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const compFunInverted = (a, b) => {
|
|
12
|
+
return b.k.length - a.k.length;
|
|
13
|
+
};
|
|
14
|
+
|
|
7
15
|
const assureSorted = (batch) => {
|
|
8
|
-
const compFun = (a, b) => {
|
|
9
|
-
return a.k.length - b.k.length;
|
|
10
|
-
};
|
|
11
16
|
batch['*'].sort(compFun);
|
|
12
|
-
batch['-'].sort(
|
|
17
|
+
batch['-'].sort(compFunInverted);
|
|
13
18
|
batch['+'].sort(compFun);
|
|
14
19
|
};
|
|
15
20
|
|