fiftyone.pipeline.core 4.5.1 → 4.5.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fiftyone.pipeline.core",
3
- "version": "4.5.1",
3
+ "version": "4.5.3",
4
4
  "description": "Core library for the 51Degrees Pipeline API",
5
5
  "keywords": [
6
6
  "51degrees",
@@ -174,14 +174,31 @@ class SetHeadersElement extends FlowElement {
174
174
  try {
175
175
  const value = element[propertyKey];
176
176
  if (value !== undefined && value !== null) {
177
- if (value instanceof AspectPropertyValue) {
177
+ // Use duck typing to check for AspectPropertyValue-like objects.
178
+ // This handles cases where the object comes from a different package
179
+ // instance (e.g., different versions in node_modules) where instanceof
180
+ // would fail even though the object has the same structure.
181
+ const isAspectPropertyValue = value instanceof AspectPropertyValue ||
182
+ (typeof value === 'object' && 'hasValue' in value);
183
+
184
+ if (isAspectPropertyValue) {
178
185
  if (value.hasValue && value.value !== 'Unknown') {
179
186
  return value.value;
180
187
  } else {
181
188
  return undefined;
182
189
  }
190
+ } else if (typeof value === 'string') {
191
+ return value;
183
192
  } else {
184
- return value.toString();
193
+ // For other types, convert to string but warn if it results in [object Object]
194
+ const strValue = value.toString();
195
+ if (strValue === '[object Object]') {
196
+ // Try to extract value property if present
197
+ if (value.value !== undefined) {
198
+ return value.value.toString();
199
+ }
200
+ }
201
+ return strValue;
185
202
  }
186
203
  }
187
204
  } catch (e) {