@umituz/react-native-ai-generation-content 1.17.174 → 1.17.175

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": "@umituz/react-native-ai-generation-content",
3
- "version": "1.17.174",
3
+ "version": "1.17.175",
4
4
  "description": "Provider-agnostic AI generation orchestration for React Native",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -34,6 +34,14 @@ export function extractOutputUrl(
34
34
  }
35
35
  }
36
36
 
37
+ // Check top-level image/video objects (for birefnet, rembg, etc.)
38
+ const topMedia =
39
+ (resultObj.image as Record<string, unknown>) ||
40
+ (resultObj.video as Record<string, unknown>);
41
+ if (topMedia && typeof topMedia === "object" && typeof topMedia.url === "string") {
42
+ return topMedia.url;
43
+ }
44
+
37
45
  // Check nested data/output objects
38
46
  const nested =
39
47
  (resultObj.data as Record<string, unknown>) ||
@@ -178,6 +186,13 @@ export function extractImageUrls(result: unknown): string[] {
178
186
  const urls: string[] = [];
179
187
  const resultObj = result as Record<string, unknown>;
180
188
 
189
+ // Check top-level image object (birefnet, rembg format)
190
+ const topImage = resultObj.image as Record<string, unknown>;
191
+ if (topImage && typeof topImage === "object" && typeof topImage.url === "string") {
192
+ urls.push(topImage.url);
193
+ return urls;
194
+ }
195
+
181
196
  // Check images array
182
197
  if (Array.isArray(resultObj.images)) {
183
198
  for (const img of resultObj.images) {