@commercetools/sync-actions 4.11.0 → 5.0.0
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/CHANGELOG.md +18 -0
- package/dist/sync-actions.cjs.js +130 -264
- package/dist/sync-actions.es.js +130 -264
- package/dist/sync-actions.umd.js +130 -264
- package/dist/sync-actions.umd.min.js +1 -1
- package/package.json +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @commercetools/sync-actions
|
|
2
2
|
|
|
3
|
+
## 5.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#1775](https://github.com/commercetools/nodejs/pull/1775) [`35669f30`](https://github.com/commercetools/nodejs/commit/35669f30dbc4b24d59ec3df3f38417b1f2a77837) Thanks [@ajimae](https://github.com/ajimae)! - Drop support for Node `v10` and `v12`. Supported versions now are `v14`, `v16` and `v18`.
|
|
8
|
+
|
|
9
|
+
## 4.13.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#1798](https://github.com/commercetools/nodejs/pull/1798) [`850325d0`](https://github.com/commercetools/nodejs/commit/850325d08603764787c387b2341e4009d0c4f788) Thanks [@markus-azer](https://github.com/markus-azer)! - support standalone prices
|
|
14
|
+
|
|
15
|
+
## 4.12.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- [#1796](https://github.com/commercetools/nodejs/pull/1796) [`7aaf91cd`](https://github.com/commercetools/nodejs/commit/7aaf91cdecb7c844943369fc137a5356becdba36) Thanks [@VineetKumarKushwaha](https://github.com/VineetKumarKushwaha)! - Fix custom types sync actions to detect addEnumValue action correctly
|
|
20
|
+
|
|
3
21
|
## 4.11.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
package/dist/sync-actions.cjs.js
CHANGED
|
@@ -23,14 +23,9 @@ function ownKeys(object, enumerableOnly) {
|
|
|
23
23
|
|
|
24
24
|
if (Object.getOwnPropertySymbols) {
|
|
25
25
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
keys.push.apply(keys, symbols);
|
|
26
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
27
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
28
|
+
})), keys.push.apply(keys, symbols);
|
|
34
29
|
}
|
|
35
30
|
|
|
36
31
|
return keys;
|
|
@@ -38,19 +33,12 @@ function ownKeys(object, enumerableOnly) {
|
|
|
38
33
|
|
|
39
34
|
function _objectSpread2(target) {
|
|
40
35
|
for (var i = 1; i < arguments.length; i++) {
|
|
41
|
-
var source = arguments[i]
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
48
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
49
|
-
} else {
|
|
50
|
-
ownKeys(Object(source)).forEach(function (key) {
|
|
51
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
52
|
-
});
|
|
53
|
-
}
|
|
36
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
37
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
38
|
+
_defineProperty(target, key, source[key]);
|
|
39
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
40
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
41
|
+
});
|
|
54
42
|
}
|
|
55
43
|
|
|
56
44
|
return target;
|
|
@@ -59,17 +47,11 @@ function _objectSpread2(target) {
|
|
|
59
47
|
function _typeof(obj) {
|
|
60
48
|
"@babel/helpers - typeof";
|
|
61
49
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
_typeof = function (obj) {
|
|
68
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return _typeof(obj);
|
|
50
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
51
|
+
return typeof obj;
|
|
52
|
+
} : function (obj) {
|
|
53
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
54
|
+
}, _typeof(obj);
|
|
73
55
|
}
|
|
74
56
|
|
|
75
57
|
function _defineProperty(obj, key, value) {
|
|
@@ -2695,78 +2677,6 @@ var shippingMethods = (function (actionGroupList, syncActionConfig) {
|
|
|
2695
2677
|
var HAS_WEAKSET_SUPPORT = typeof WeakSet === 'function';
|
|
2696
2678
|
var keys = Object.keys;
|
|
2697
2679
|
/**
|
|
2698
|
-
* @function addToCache
|
|
2699
|
-
*
|
|
2700
|
-
* add object to cache if an object
|
|
2701
|
-
*
|
|
2702
|
-
* @param value the value to potentially add to cache
|
|
2703
|
-
* @param cache the cache to add to
|
|
2704
|
-
*/
|
|
2705
|
-
|
|
2706
|
-
function addToCache(value, cache) {
|
|
2707
|
-
if (value && _typeof(value) === 'object') {
|
|
2708
|
-
cache.add(value);
|
|
2709
|
-
}
|
|
2710
|
-
}
|
|
2711
|
-
/**
|
|
2712
|
-
* @function hasPair
|
|
2713
|
-
*
|
|
2714
|
-
* @description
|
|
2715
|
-
* does the `pairToMatch` exist in the list of `pairs` provided based on the
|
|
2716
|
-
* `isEqual` check
|
|
2717
|
-
*
|
|
2718
|
-
* @param pairs the pairs to compare against
|
|
2719
|
-
* @param pairToMatch the pair to match
|
|
2720
|
-
* @param isEqual the equality comparator used
|
|
2721
|
-
* @param meta the meta provided
|
|
2722
|
-
* @returns does the pair exist in the pairs provided
|
|
2723
|
-
*/
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
function hasPair(pairs, pairToMatch, isEqual, meta) {
|
|
2727
|
-
var length = pairs.length;
|
|
2728
|
-
var pair;
|
|
2729
|
-
|
|
2730
|
-
for (var index = 0; index < length; index++) {
|
|
2731
|
-
pair = pairs[index];
|
|
2732
|
-
|
|
2733
|
-
if (isEqual(pair[0], pairToMatch[0], meta) && isEqual(pair[1], pairToMatch[1], meta)) {
|
|
2734
|
-
return true;
|
|
2735
|
-
}
|
|
2736
|
-
}
|
|
2737
|
-
|
|
2738
|
-
return false;
|
|
2739
|
-
}
|
|
2740
|
-
/**
|
|
2741
|
-
* @function hasValue
|
|
2742
|
-
*
|
|
2743
|
-
* @description
|
|
2744
|
-
* does the `valueToMatch` exist in the list of `values` provided based on the
|
|
2745
|
-
* `isEqual` check
|
|
2746
|
-
*
|
|
2747
|
-
* @param values the values to compare against
|
|
2748
|
-
* @param valueToMatch the value to match
|
|
2749
|
-
* @param isEqual the equality comparator used
|
|
2750
|
-
* @param meta the meta provided
|
|
2751
|
-
* @returns does the value exist in the values provided
|
|
2752
|
-
*/
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
function hasValue(values, valueToMatch, isEqual, meta) {
|
|
2756
|
-
var length = values.length;
|
|
2757
|
-
|
|
2758
|
-
for (var index = 0; index < length; index++) {
|
|
2759
|
-
if (isEqual(values[index], valueToMatch, meta)) {
|
|
2760
|
-
return true;
|
|
2761
|
-
}
|
|
2762
|
-
}
|
|
2763
|
-
|
|
2764
|
-
return false;
|
|
2765
|
-
}
|
|
2766
|
-
/**
|
|
2767
|
-
* @function sameValueZeroEqual
|
|
2768
|
-
*
|
|
2769
|
-
* @description
|
|
2770
2680
|
* are the values passed strictly equal or both NaN
|
|
2771
2681
|
*
|
|
2772
2682
|
* @param a the value to compare against
|
|
@@ -2774,14 +2684,10 @@ function hasValue(values, valueToMatch, isEqual, meta) {
|
|
|
2774
2684
|
* @returns are the values equal by the SameValueZero principle
|
|
2775
2685
|
*/
|
|
2776
2686
|
|
|
2777
|
-
|
|
2778
2687
|
function sameValueZeroEqual(a, b) {
|
|
2779
2688
|
return a === b || a !== a && b !== b;
|
|
2780
2689
|
}
|
|
2781
2690
|
/**
|
|
2782
|
-
* @function isPlainObject
|
|
2783
|
-
*
|
|
2784
|
-
* @description
|
|
2785
2691
|
* is the value a plain object
|
|
2786
2692
|
*
|
|
2787
2693
|
* @param value the value to test
|
|
@@ -2793,9 +2699,6 @@ function isPlainObject(value) {
|
|
|
2793
2699
|
return value.constructor === Object || value.constructor == null;
|
|
2794
2700
|
}
|
|
2795
2701
|
/**
|
|
2796
|
-
* @function isPromiseLike
|
|
2797
|
-
*
|
|
2798
|
-
* @description
|
|
2799
2702
|
* is the value promise-like (meaning it is thenable)
|
|
2800
2703
|
*
|
|
2801
2704
|
* @param value the value to test
|
|
@@ -2807,9 +2710,6 @@ function isPromiseLike(value) {
|
|
|
2807
2710
|
return !!value && typeof value.then === 'function';
|
|
2808
2711
|
}
|
|
2809
2712
|
/**
|
|
2810
|
-
* @function isReactElement
|
|
2811
|
-
*
|
|
2812
|
-
* @description
|
|
2813
2713
|
* is the value passed a react element
|
|
2814
2714
|
*
|
|
2815
2715
|
* @param value the value to test
|
|
@@ -2821,9 +2721,6 @@ function isReactElement(value) {
|
|
|
2821
2721
|
return !!(value && value.$$typeof);
|
|
2822
2722
|
}
|
|
2823
2723
|
/**
|
|
2824
|
-
* @function getNewCacheFallback
|
|
2825
|
-
*
|
|
2826
|
-
* @description
|
|
2827
2724
|
* in cases where WeakSet is not supported, creates a new custom
|
|
2828
2725
|
* object that mimics the necessary API aspects for cache purposes
|
|
2829
2726
|
*
|
|
@@ -2832,20 +2729,17 @@ function isReactElement(value) {
|
|
|
2832
2729
|
|
|
2833
2730
|
|
|
2834
2731
|
function getNewCacheFallback() {
|
|
2835
|
-
|
|
2836
|
-
|
|
2732
|
+
var values = [];
|
|
2733
|
+
return {
|
|
2837
2734
|
add: function add(value) {
|
|
2838
|
-
|
|
2735
|
+
values.push(value);
|
|
2839
2736
|
},
|
|
2840
2737
|
has: function has(value) {
|
|
2841
|
-
return
|
|
2738
|
+
return values.indexOf(value) !== -1;
|
|
2842
2739
|
}
|
|
2843
|
-
}
|
|
2740
|
+
};
|
|
2844
2741
|
}
|
|
2845
2742
|
/**
|
|
2846
|
-
* @function getNewCache
|
|
2847
|
-
*
|
|
2848
|
-
* @description
|
|
2849
2743
|
* get a new cache object to prevent circular references
|
|
2850
2744
|
*
|
|
2851
2745
|
* @returns the new cache object
|
|
@@ -2862,9 +2756,6 @@ var getNewCache = function (canUseWeakMap) {
|
|
|
2862
2756
|
return getNewCacheFallback;
|
|
2863
2757
|
}(HAS_WEAKSET_SUPPORT);
|
|
2864
2758
|
/**
|
|
2865
|
-
* @function createCircularEqualCreator
|
|
2866
|
-
*
|
|
2867
|
-
* @description
|
|
2868
2759
|
* create a custom isEqual handler specific to circular objects
|
|
2869
2760
|
*
|
|
2870
2761
|
* @param [isEqual] the isEqual comparator to use instead of isDeepEqual
|
|
@@ -2881,61 +2772,31 @@ function createCircularEqualCreator(isEqual) {
|
|
|
2881
2772
|
cache = getNewCache();
|
|
2882
2773
|
}
|
|
2883
2774
|
|
|
2884
|
-
var
|
|
2885
|
-
var
|
|
2775
|
+
var isCacheableA = !!a && _typeof(a) === 'object';
|
|
2776
|
+
var isCacheableB = !!b && _typeof(b) === 'object';
|
|
2777
|
+
|
|
2778
|
+
if (isCacheableA || isCacheableB) {
|
|
2779
|
+
var hasA = isCacheableA && cache.has(a);
|
|
2780
|
+
var hasB = isCacheableB && cache.has(b);
|
|
2886
2781
|
|
|
2887
|
-
|
|
2888
|
-
|
|
2782
|
+
if (hasA || hasB) {
|
|
2783
|
+
return hasA && hasB;
|
|
2784
|
+
}
|
|
2785
|
+
|
|
2786
|
+
if (isCacheableA) {
|
|
2787
|
+
cache.add(a);
|
|
2788
|
+
}
|
|
2789
|
+
|
|
2790
|
+
if (isCacheableB) {
|
|
2791
|
+
cache.add(b);
|
|
2792
|
+
}
|
|
2889
2793
|
}
|
|
2890
2794
|
|
|
2891
|
-
addToCache(a, cache);
|
|
2892
|
-
addToCache(b, cache);
|
|
2893
2795
|
return _comparator(a, b, cache);
|
|
2894
2796
|
};
|
|
2895
2797
|
};
|
|
2896
2798
|
}
|
|
2897
2799
|
/**
|
|
2898
|
-
* @function toPairs
|
|
2899
|
-
*
|
|
2900
|
-
* @description
|
|
2901
|
-
* convert the map passed into pairs (meaning an array of [key, value] tuples)
|
|
2902
|
-
*
|
|
2903
|
-
* @param map the map to convert to [key, value] pairs (entries)
|
|
2904
|
-
* @returns the [key, value] pairs
|
|
2905
|
-
*/
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
function toPairs(map) {
|
|
2909
|
-
var pairs = new Array(map.size);
|
|
2910
|
-
var index = 0;
|
|
2911
|
-
map.forEach(function (value, key) {
|
|
2912
|
-
pairs[index++] = [key, value];
|
|
2913
|
-
});
|
|
2914
|
-
return pairs;
|
|
2915
|
-
}
|
|
2916
|
-
/**
|
|
2917
|
-
* @function toValues
|
|
2918
|
-
*
|
|
2919
|
-
* @description
|
|
2920
|
-
* convert the set passed into values
|
|
2921
|
-
*
|
|
2922
|
-
* @param set the set to convert to values
|
|
2923
|
-
* @returns the values
|
|
2924
|
-
*/
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
function toValues(set) {
|
|
2928
|
-
var values = new Array(set.size);
|
|
2929
|
-
var index = 0;
|
|
2930
|
-
set.forEach(function (value) {
|
|
2931
|
-
values[index++] = value;
|
|
2932
|
-
});
|
|
2933
|
-
return values;
|
|
2934
|
-
}
|
|
2935
|
-
/**
|
|
2936
|
-
* @function areArraysEqual
|
|
2937
|
-
*
|
|
2938
|
-
* @description
|
|
2939
2800
|
* are the arrays equal in value
|
|
2940
2801
|
*
|
|
2941
2802
|
* @param a the array to test
|
|
@@ -2947,13 +2808,13 @@ function toValues(set) {
|
|
|
2947
2808
|
|
|
2948
2809
|
|
|
2949
2810
|
function areArraysEqual(a, b, isEqual, meta) {
|
|
2950
|
-
var
|
|
2811
|
+
var index = a.length;
|
|
2951
2812
|
|
|
2952
|
-
if (b.length !==
|
|
2813
|
+
if (b.length !== index) {
|
|
2953
2814
|
return false;
|
|
2954
2815
|
}
|
|
2955
2816
|
|
|
2956
|
-
|
|
2817
|
+
while (index-- > 0) {
|
|
2957
2818
|
if (!isEqual(a[index], b[index], meta)) {
|
|
2958
2819
|
return false;
|
|
2959
2820
|
}
|
|
@@ -2962,9 +2823,6 @@ function areArraysEqual(a, b, isEqual, meta) {
|
|
|
2962
2823
|
return true;
|
|
2963
2824
|
}
|
|
2964
2825
|
/**
|
|
2965
|
-
* @function areMapsEqual
|
|
2966
|
-
*
|
|
2967
|
-
* @description
|
|
2968
2826
|
* are the maps equal in value
|
|
2969
2827
|
*
|
|
2970
2828
|
* @param a the map to test
|
|
@@ -2976,29 +2834,36 @@ function areArraysEqual(a, b, isEqual, meta) {
|
|
|
2976
2834
|
|
|
2977
2835
|
|
|
2978
2836
|
function areMapsEqual(a, b, isEqual, meta) {
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2837
|
+
var isValueEqual = a.size === b.size;
|
|
2838
|
+
|
|
2839
|
+
if (isValueEqual && a.size) {
|
|
2840
|
+
var matchedIndices_1 = {};
|
|
2841
|
+
a.forEach(function (aValue, aKey) {
|
|
2842
|
+
if (isValueEqual) {
|
|
2843
|
+
var hasMatch_1 = false;
|
|
2844
|
+
var matchIndex_1 = 0;
|
|
2845
|
+
b.forEach(function (bValue, bKey) {
|
|
2846
|
+
if (!hasMatch_1 && !matchedIndices_1[matchIndex_1]) {
|
|
2847
|
+
hasMatch_1 = isEqual(aKey, bKey, meta) && isEqual(aValue, bValue, meta);
|
|
2848
|
+
|
|
2849
|
+
if (hasMatch_1) {
|
|
2850
|
+
matchedIndices_1[matchIndex_1] = true;
|
|
2851
|
+
}
|
|
2852
|
+
}
|
|
2986
2853
|
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2854
|
+
matchIndex_1++;
|
|
2855
|
+
});
|
|
2856
|
+
isValueEqual = hasMatch_1;
|
|
2857
|
+
}
|
|
2858
|
+
});
|
|
2991
2859
|
}
|
|
2992
2860
|
|
|
2993
|
-
return
|
|
2861
|
+
return isValueEqual;
|
|
2994
2862
|
}
|
|
2995
2863
|
|
|
2996
2864
|
var OWNER = '_owner';
|
|
2997
2865
|
var hasOwnProperty = Function.prototype.bind.call(Function.prototype.call, Object.prototype.hasOwnProperty);
|
|
2998
2866
|
/**
|
|
2999
|
-
* @function areObjectsEqual
|
|
3000
|
-
*
|
|
3001
|
-
* @description
|
|
3002
2867
|
* are the objects equal in value
|
|
3003
2868
|
*
|
|
3004
2869
|
* @param a the object to test
|
|
@@ -3010,36 +2875,36 @@ var hasOwnProperty = Function.prototype.bind.call(Function.prototype.call, Objec
|
|
|
3010
2875
|
|
|
3011
2876
|
function areObjectsEqual(a, b, isEqual, meta) {
|
|
3012
2877
|
var keysA = keys(a);
|
|
3013
|
-
var
|
|
2878
|
+
var index = keysA.length;
|
|
3014
2879
|
|
|
3015
|
-
if (keys(b).length !==
|
|
2880
|
+
if (keys(b).length !== index) {
|
|
3016
2881
|
return false;
|
|
3017
2882
|
}
|
|
3018
2883
|
|
|
3019
|
-
|
|
2884
|
+
if (index) {
|
|
2885
|
+
var key = void 0;
|
|
3020
2886
|
|
|
3021
|
-
|
|
3022
|
-
|
|
2887
|
+
while (index-- > 0) {
|
|
2888
|
+
key = keysA[index];
|
|
3023
2889
|
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
2890
|
+
if (key === OWNER) {
|
|
2891
|
+
var reactElementA = isReactElement(a);
|
|
2892
|
+
var reactElementB = isReactElement(b);
|
|
3027
2893
|
|
|
3028
|
-
|
|
3029
|
-
|
|
2894
|
+
if ((reactElementA || reactElementB) && reactElementA !== reactElementB) {
|
|
2895
|
+
return false;
|
|
2896
|
+
}
|
|
2897
|
+
}
|
|
2898
|
+
|
|
2899
|
+
if (!hasOwnProperty(b, key) || !isEqual(a[key], b[key], meta)) {
|
|
3030
2900
|
return false;
|
|
3031
2901
|
}
|
|
3032
|
-
} else if (!isEqual(a[key], b[key], meta)) {
|
|
3033
|
-
return false;
|
|
3034
2902
|
}
|
|
3035
2903
|
}
|
|
3036
2904
|
|
|
3037
2905
|
return true;
|
|
3038
2906
|
}
|
|
3039
2907
|
/**
|
|
3040
|
-
* @function areRegExpsEqual
|
|
3041
|
-
*
|
|
3042
|
-
* @description
|
|
3043
2908
|
* are the regExps equal in value
|
|
3044
2909
|
*
|
|
3045
2910
|
* @param a the regExp to test
|
|
@@ -3052,9 +2917,6 @@ function areRegExpsEqual(a, b) {
|
|
|
3052
2917
|
return a.source === b.source && a.global === b.global && a.ignoreCase === b.ignoreCase && a.multiline === b.multiline && a.unicode === b.unicode && a.sticky === b.sticky && a.lastIndex === b.lastIndex;
|
|
3053
2918
|
}
|
|
3054
2919
|
/**
|
|
3055
|
-
* @function areSetsEqual
|
|
3056
|
-
*
|
|
3057
|
-
* @description
|
|
3058
2920
|
* are the sets equal in value
|
|
3059
2921
|
*
|
|
3060
2922
|
* @param a the set to test
|
|
@@ -3066,27 +2928,35 @@ function areRegExpsEqual(a, b) {
|
|
|
3066
2928
|
|
|
3067
2929
|
|
|
3068
2930
|
function areSetsEqual(a, b, isEqual, meta) {
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
2931
|
+
var isValueEqual = a.size === b.size;
|
|
2932
|
+
|
|
2933
|
+
if (isValueEqual && a.size) {
|
|
2934
|
+
var matchedIndices_2 = {};
|
|
2935
|
+
a.forEach(function (aValue) {
|
|
2936
|
+
if (isValueEqual) {
|
|
2937
|
+
var hasMatch_2 = false;
|
|
2938
|
+
var matchIndex_2 = 0;
|
|
2939
|
+
b.forEach(function (bValue) {
|
|
2940
|
+
if (!hasMatch_2 && !matchedIndices_2[matchIndex_2]) {
|
|
2941
|
+
hasMatch_2 = isEqual(aValue, bValue, meta);
|
|
2942
|
+
|
|
2943
|
+
if (hasMatch_2) {
|
|
2944
|
+
matchedIndices_2[matchIndex_2] = true;
|
|
2945
|
+
}
|
|
2946
|
+
}
|
|
3076
2947
|
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
2948
|
+
matchIndex_2++;
|
|
2949
|
+
});
|
|
2950
|
+
isValueEqual = hasMatch_2;
|
|
2951
|
+
}
|
|
2952
|
+
});
|
|
3081
2953
|
}
|
|
3082
2954
|
|
|
3083
|
-
return
|
|
2955
|
+
return isValueEqual;
|
|
3084
2956
|
}
|
|
3085
2957
|
|
|
3086
|
-
var isArray = Array.isArray;
|
|
3087
2958
|
var HAS_MAP_SUPPORT = typeof Map === 'function';
|
|
3088
2959
|
var HAS_SET_SUPPORT = typeof Set === 'function';
|
|
3089
|
-
var OBJECT_TYPEOF = 'object';
|
|
3090
2960
|
|
|
3091
2961
|
function createComparator(createIsEqual) {
|
|
3092
2962
|
var isEqual =
|
|
@@ -3095,9 +2965,6 @@ function createComparator(createIsEqual) {
|
|
|
3095
2965
|
/* eslint-enable */
|
|
3096
2966
|
|
|
3097
2967
|
/**
|
|
3098
|
-
* @function comparator
|
|
3099
|
-
*
|
|
3100
|
-
* @description
|
|
3101
2968
|
* compare the value of the two objects and return true if they are equivalent in values
|
|
3102
2969
|
*
|
|
3103
2970
|
* @param a the value to test against
|
|
@@ -3107,34 +2974,34 @@ function createComparator(createIsEqual) {
|
|
|
3107
2974
|
*/
|
|
3108
2975
|
|
|
3109
2976
|
function comparator(a, b, meta) {
|
|
3110
|
-
if (
|
|
2977
|
+
if (a === b) {
|
|
3111
2978
|
return true;
|
|
3112
2979
|
}
|
|
3113
2980
|
|
|
3114
|
-
if (a && b && _typeof(a) ===
|
|
2981
|
+
if (a && b && _typeof(a) === 'object' && _typeof(b) === 'object') {
|
|
3115
2982
|
if (isPlainObject(a) && isPlainObject(b)) {
|
|
3116
2983
|
return areObjectsEqual(a, b, isEqual, meta);
|
|
3117
2984
|
}
|
|
3118
2985
|
|
|
3119
|
-
var
|
|
3120
|
-
var
|
|
2986
|
+
var aShape = Array.isArray(a);
|
|
2987
|
+
var bShape = Array.isArray(b);
|
|
3121
2988
|
|
|
3122
|
-
if (
|
|
3123
|
-
return
|
|
2989
|
+
if (aShape || bShape) {
|
|
2990
|
+
return aShape === bShape && areArraysEqual(a, b, isEqual, meta);
|
|
3124
2991
|
}
|
|
3125
2992
|
|
|
3126
|
-
|
|
3127
|
-
|
|
2993
|
+
aShape = a instanceof Date;
|
|
2994
|
+
bShape = b instanceof Date;
|
|
3128
2995
|
|
|
3129
|
-
if (
|
|
3130
|
-
return
|
|
2996
|
+
if (aShape || bShape) {
|
|
2997
|
+
return aShape === bShape && sameValueZeroEqual(a.getTime(), b.getTime());
|
|
3131
2998
|
}
|
|
3132
2999
|
|
|
3133
|
-
|
|
3134
|
-
|
|
3000
|
+
aShape = a instanceof RegExp;
|
|
3001
|
+
bShape = b instanceof RegExp;
|
|
3135
3002
|
|
|
3136
|
-
if (
|
|
3137
|
-
return
|
|
3003
|
+
if (aShape || bShape) {
|
|
3004
|
+
return aShape === bShape && areRegExpsEqual(a, b);
|
|
3138
3005
|
}
|
|
3139
3006
|
|
|
3140
3007
|
if (isPromiseLike(a) || isPromiseLike(b)) {
|
|
@@ -3142,32 +3009,31 @@ function createComparator(createIsEqual) {
|
|
|
3142
3009
|
}
|
|
3143
3010
|
|
|
3144
3011
|
if (HAS_MAP_SUPPORT) {
|
|
3145
|
-
|
|
3146
|
-
|
|
3012
|
+
aShape = a instanceof Map;
|
|
3013
|
+
bShape = b instanceof Map;
|
|
3147
3014
|
|
|
3148
|
-
if (
|
|
3149
|
-
return
|
|
3015
|
+
if (aShape || bShape) {
|
|
3016
|
+
return aShape === bShape && areMapsEqual(a, b, isEqual, meta);
|
|
3150
3017
|
}
|
|
3151
3018
|
}
|
|
3152
3019
|
|
|
3153
3020
|
if (HAS_SET_SUPPORT) {
|
|
3154
|
-
|
|
3155
|
-
|
|
3021
|
+
aShape = a instanceof Set;
|
|
3022
|
+
bShape = b instanceof Set;
|
|
3156
3023
|
|
|
3157
|
-
if (
|
|
3158
|
-
return
|
|
3024
|
+
if (aShape || bShape) {
|
|
3025
|
+
return aShape === bShape && areSetsEqual(a, b, isEqual, meta);
|
|
3159
3026
|
}
|
|
3160
3027
|
}
|
|
3161
3028
|
|
|
3162
3029
|
return areObjectsEqual(a, b, isEqual, meta);
|
|
3163
3030
|
}
|
|
3164
3031
|
|
|
3165
|
-
return
|
|
3032
|
+
return a !== a && b !== b;
|
|
3166
3033
|
}
|
|
3167
3034
|
|
|
3168
3035
|
return comparator;
|
|
3169
|
-
}
|
|
3170
|
-
|
|
3036
|
+
}
|
|
3171
3037
|
|
|
3172
3038
|
var deepEqual = createComparator();
|
|
3173
3039
|
createComparator(function () {
|
|
@@ -3612,14 +3478,14 @@ function actionsMapBase$3(diff, oldObj, newObj) {
|
|
|
3612
3478
|
});
|
|
3613
3479
|
}
|
|
3614
3480
|
|
|
3615
|
-
function actionsMapEnums(attributeType, attributeDiff, previous, next) {
|
|
3481
|
+
function actionsMapEnums(fieldName, attributeType, attributeDiff, previous, next) {
|
|
3616
3482
|
var _createBuildArrayActi;
|
|
3617
3483
|
|
|
3618
|
-
var addEnumActionName = attributeType === '
|
|
3619
|
-
var changeEnumOrderActionName = attributeType === '
|
|
3484
|
+
var addEnumActionName = attributeType === 'Enum' ? 'addEnumValue' : 'addLocalizedEnumValue';
|
|
3485
|
+
var changeEnumOrderActionName = attributeType === 'Enum' ? 'changeEnumValueOrder' : 'changeLocalizedEnumValueOrder';
|
|
3620
3486
|
var buildArrayActions = createBuildArrayActions('values', (_createBuildArrayActi = {}, _defineProperty(_createBuildArrayActi, ADD_ACTIONS, function (newEnum) {
|
|
3621
3487
|
return {
|
|
3622
|
-
fieldName:
|
|
3488
|
+
fieldName: fieldName,
|
|
3623
3489
|
action: addEnumActionName,
|
|
3624
3490
|
value: newEnum
|
|
3625
3491
|
};
|
|
@@ -3635,13 +3501,13 @@ function actionsMapEnums(attributeType, attributeDiff, previous, next) {
|
|
|
3635
3501
|
|
|
3636
3502
|
if (oldEnumInNext) {
|
|
3637
3503
|
changeActions.push({
|
|
3638
|
-
fieldName:
|
|
3504
|
+
fieldName: fieldName,
|
|
3639
3505
|
action: changeEnumOrderActionName,
|
|
3640
3506
|
value: newEnum
|
|
3641
3507
|
});
|
|
3642
3508
|
} else {
|
|
3643
3509
|
changeActions.push({
|
|
3644
|
-
fieldName:
|
|
3510
|
+
fieldName: fieldName,
|
|
3645
3511
|
action: addEnumActionName,
|
|
3646
3512
|
value: newEnum
|
|
3647
3513
|
});
|
|
@@ -3659,7 +3525,7 @@ function actionsMapEnums(attributeType, attributeDiff, previous, next) {
|
|
|
3659
3525
|
} else actions.push(updateAction);
|
|
3660
3526
|
});
|
|
3661
3527
|
return [].concat(actions, _toConsumableArray(newEnumValuesOrder.length > 0 ? [{
|
|
3662
|
-
fieldName:
|
|
3528
|
+
fieldName: fieldName,
|
|
3663
3529
|
action: changeEnumOrderActionName,
|
|
3664
3530
|
keys: newEnumValuesOrder
|
|
3665
3531
|
}] : []));
|
|
@@ -3687,7 +3553,7 @@ function actionsMapFieldDefinitions(fieldDefinitionsDiff, previous, next, diffPa
|
|
|
3687
3553
|
fieldName: extractedPairs.oldObj.name
|
|
3688
3554
|
});
|
|
3689
3555
|
} else if (diffValue.type.values) {
|
|
3690
|
-
actions.push.apply(actions, _toConsumableArray(actionsMapEnums(extractedPairs.oldObj.type.name, diffValue.type, extractedPairs.oldObj.type, extractedPairs.newObj.type)));
|
|
3556
|
+
actions.push.apply(actions, _toConsumableArray(actionsMapEnums(extractedPairs.oldObj.name, extractedPairs.oldObj.type.name, diffValue.type, extractedPairs.oldObj.type, extractedPairs.newObj.type)));
|
|
3691
3557
|
}
|
|
3692
3558
|
} else if (getIsRemovedOperation(diffKey)) {
|
|
3693
3559
|
if (Array.isArray(diffValue)) {
|