@tangle-network/agent-interface 5.2.0 → 5.2.1
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/agent-profile.js +9 -2
- package/dist/profile-diff.js +8 -0
- package/package.json +1 -1
package/dist/agent-profile.js
CHANGED
|
@@ -96,8 +96,15 @@ function assignDefined(...sources) {
|
|
|
96
96
|
if (source === undefined)
|
|
97
97
|
continue;
|
|
98
98
|
for (const [key, value] of Object.entries(source)) {
|
|
99
|
-
if (value !== undefined)
|
|
100
|
-
|
|
99
|
+
if (value !== undefined) {
|
|
100
|
+
// Define own data properties like object spread, including __proto__.
|
|
101
|
+
Object.defineProperty(merged, key, {
|
|
102
|
+
value,
|
|
103
|
+
enumerable: true,
|
|
104
|
+
configurable: true,
|
|
105
|
+
writable: true,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
101
108
|
}
|
|
102
109
|
}
|
|
103
110
|
return merged;
|
package/dist/profile-diff.js
CHANGED
|
@@ -119,6 +119,14 @@ function replaceChangedProfileResources(baseline, candidate, remove, set) {
|
|
|
119
119
|
}
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
|
+
// Resource removals prune empty sibling arrays. Restore only the candidate's
|
|
123
|
+
// explicit empties, without copying unchanged nonempty or external resources.
|
|
124
|
+
for (const axis of agentProfileResourceDiffPropertyAxes) {
|
|
125
|
+
const value = candidate?.[axis];
|
|
126
|
+
if (Array.isArray(value) && value.length === 0) {
|
|
127
|
+
Object.assign(resourceSet, { [axis]: [] });
|
|
128
|
+
}
|
|
129
|
+
}
|
|
122
130
|
remove.resources = resourceRemove;
|
|
123
131
|
const canonicalCandidate = canonicalProfileValue(candidate);
|
|
124
132
|
if (Object.keys(resourceSet).length > 0 ||
|