@bbn/bbn 2.0.184 → 2.0.186
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/bbn.js +1 -1
- package/dist/bbn.js.map +1 -1
- package/dist/dt/classes/dt.js +2 -1
- package/dist/fn/object/mutateObject.js +0 -10
- package/package.json +1 -1
package/dist/dt/classes/dt.js
CHANGED
|
@@ -959,7 +959,8 @@ export class bbnDt {
|
|
|
959
959
|
throw new Error('Invalid unit for diff: ' + unit);
|
|
960
960
|
}
|
|
961
961
|
const [, , ms] = match; // [shortUnit, rtfUnit, ms]
|
|
962
|
-
|
|
962
|
+
const result = diff / ms;
|
|
963
|
+
return result < 0 ? Math.ceil(result) : Math.floor(result);
|
|
963
964
|
}
|
|
964
965
|
guessUnit(valueInMs) {
|
|
965
966
|
const absDiff = Math.abs(valueInMs);
|
|
@@ -2,8 +2,6 @@ import isObject from '../type/isObject.js';
|
|
|
2
2
|
import hash from '../string/hash.js';
|
|
3
3
|
import isSame from '../type/isSame.js';
|
|
4
4
|
import checkType from '../type/checkType.js';
|
|
5
|
-
import isArray from '../type/isArray.js';
|
|
6
|
-
import mutateArray from './mutateArray.js';
|
|
7
5
|
export default function mutateObject(a1, a2, hashFn) {
|
|
8
6
|
if (!isObject(a1, a2)) {
|
|
9
7
|
throw new TypeError('mutateObject can only be called with objects parameters');
|
|
@@ -23,14 +21,6 @@ export default function mutateObject(a1, a2, hashFn) {
|
|
|
23
21
|
}
|
|
24
22
|
mapA2.forEach(n => {
|
|
25
23
|
if (!isSame(a1[n], a2[n])) {
|
|
26
|
-
if (isObject(a1[n], a2[n])) {
|
|
27
|
-
mutateObject(a1[n], a2[n], hashFn);
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
if (isArray(a1[n], a2[n])) {
|
|
31
|
-
mutateArray(a1[n], a2[n], hashFn);
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
24
|
a1[n] = a2[n];
|
|
35
25
|
}
|
|
36
26
|
});
|