@bian-womp/spark-graph 0.3.63 → 0.3.65
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/lib/cjs/index.cjs +6 -1
- package/lib/cjs/index.cjs.map +1 -1
- package/lib/cjs/src/misc/utils/json.d.ts +1 -1
- package/lib/cjs/src/misc/utils/json.d.ts.map +1 -1
- package/lib/cjs/src/runtime/GraphLifecycleApi.d.ts +1 -1
- package/lib/cjs/src/runtime/GraphLifecycleApi.d.ts.map +1 -1
- package/lib/esm/index.js +6 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/src/misc/utils/json.d.ts +1 -1
- package/lib/esm/src/misc/utils/json.d.ts.map +1 -1
- package/lib/esm/src/runtime/GraphLifecycleApi.d.ts +1 -1
- package/lib/esm/src/runtime/GraphLifecycleApi.d.ts.map +1 -1
- package/package.json +2 -2
package/lib/cjs/index.cjs
CHANGED
|
@@ -1111,9 +1111,11 @@ function setValueAtPathWithCreation(root, pathSegments, value) {
|
|
|
1111
1111
|
if (value === null) {
|
|
1112
1112
|
const result = getValueAtPath(root, pathSegments);
|
|
1113
1113
|
if (result && result.parent !== null && !Array.isArray(result.parent)) {
|
|
1114
|
+
const hadValue = result.key in result.parent;
|
|
1114
1115
|
delete result.parent[result.key];
|
|
1116
|
+
return hadValue;
|
|
1115
1117
|
}
|
|
1116
|
-
return;
|
|
1118
|
+
return false;
|
|
1117
1119
|
}
|
|
1118
1120
|
if (!root || typeof root !== "object" || Array.isArray(root)) {
|
|
1119
1121
|
throw new Error("Root must be an object");
|
|
@@ -1145,7 +1147,10 @@ function setValueAtPathWithCreation(root, pathSegments, value) {
|
|
|
1145
1147
|
if (!current || typeof current !== "object" || Array.isArray(current)) {
|
|
1146
1148
|
throw new Error(`Cannot set value: parent at final segment is not an object`);
|
|
1147
1149
|
}
|
|
1150
|
+
const hadValue = lastSegment in current;
|
|
1151
|
+
const oldValue = current[lastSegment];
|
|
1148
1152
|
current[lastSegment] = value;
|
|
1153
|
+
return !hadValue || JSON.stringify(oldValue) !== JSON.stringify(value);
|
|
1149
1154
|
}
|
|
1150
1155
|
else {
|
|
1151
1156
|
throw new Error("Array indices not supported in extData paths");
|