@micromag/core 0.3.124 → 0.3.126
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/es/utils.js +16 -2
- package/lib/utils.js +16 -2
- package/package.json +2 -2
package/es/utils.js
CHANGED
|
@@ -928,8 +928,22 @@ var setValue = function setValue(value, keyParts, fieldValue) {
|
|
|
928
928
|
if (isArray) {
|
|
929
929
|
var index = parseInt(key, 10); // TODO: fix this with an explicit delete
|
|
930
930
|
// instead on splicing out the element on null fieldValue
|
|
931
|
-
|
|
932
|
-
|
|
931
|
+
// const newArrayValue =
|
|
932
|
+
// fieldValue !== null
|
|
933
|
+
// ? [
|
|
934
|
+
// ...value.slice(0, index),
|
|
935
|
+
// keyParts.length > 0
|
|
936
|
+
// ? setValue(
|
|
937
|
+
// value !== null ? value[index] || null : null,
|
|
938
|
+
// keyParts,
|
|
939
|
+
// fieldValue,
|
|
940
|
+
// )
|
|
941
|
+
// : fieldValue,
|
|
942
|
+
// ...value.slice(index + 1),
|
|
943
|
+
// ]
|
|
944
|
+
// : [...value.slice(0, index), ...value.slice(index + 1)];
|
|
945
|
+
|
|
946
|
+
var newArrayValue = [].concat(_toConsumableArray(value.slice(0, index)), [keyParts.length > 0 ? setValue(value !== null ? value[index] || null : null, keyParts, fieldValue) : fieldValue], _toConsumableArray(value.slice(index + 1)));
|
|
933
947
|
return newArrayValue.length > 0 ? newArrayValue : null;
|
|
934
948
|
}
|
|
935
949
|
|
package/lib/utils.js
CHANGED
|
@@ -947,8 +947,22 @@ var setValue = function setValue(value, keyParts, fieldValue) {
|
|
|
947
947
|
if (isArray) {
|
|
948
948
|
var index = parseInt(key, 10); // TODO: fix this with an explicit delete
|
|
949
949
|
// instead on splicing out the element on null fieldValue
|
|
950
|
-
|
|
951
|
-
|
|
950
|
+
// const newArrayValue =
|
|
951
|
+
// fieldValue !== null
|
|
952
|
+
// ? [
|
|
953
|
+
// ...value.slice(0, index),
|
|
954
|
+
// keyParts.length > 0
|
|
955
|
+
// ? setValue(
|
|
956
|
+
// value !== null ? value[index] || null : null,
|
|
957
|
+
// keyParts,
|
|
958
|
+
// fieldValue,
|
|
959
|
+
// )
|
|
960
|
+
// : fieldValue,
|
|
961
|
+
// ...value.slice(index + 1),
|
|
962
|
+
// ]
|
|
963
|
+
// : [...value.slice(0, index), ...value.slice(index + 1)];
|
|
964
|
+
|
|
965
|
+
var newArrayValue = [].concat(_toConsumableArray__default["default"](value.slice(0, index)), [keyParts.length > 0 ? setValue(value !== null ? value[index] || null : null, keyParts, fieldValue) : fieldValue], _toConsumableArray__default["default"](value.slice(index + 1)));
|
|
952
966
|
return newArrayValue.length > 0 ? newArrayValue : null;
|
|
953
967
|
}
|
|
954
968
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.126",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -132,5 +132,5 @@
|
|
|
132
132
|
"publishConfig": {
|
|
133
133
|
"access": "public"
|
|
134
134
|
},
|
|
135
|
-
"gitHead": "
|
|
135
|
+
"gitHead": "079203c5850c4aa771bc4fa1c567d2db1bc3ee3d"
|
|
136
136
|
}
|