@umituz/react-native-ai-generation-content 1.26.22 → 1.26.24

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.26.22",
3
+ "version": "1.26.24",
4
4
  "description": "Provider-agnostic AI generation orchestration for React Native with result preview components",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -183,7 +183,7 @@ async function buildGenerationInput(
183
183
  throw new Error(`Scenario "${scenario.id}" must have aiPrompt field`);
184
184
  }
185
185
 
186
- const prompt = scenario.aiPrompt;
186
+ let prompt = scenario.aiPrompt;
187
187
  const outputType = scenario.outputType || "video";
188
188
 
189
189
  // For image generation, enhance prompt with style selections
package/src/index.ts CHANGED
@@ -59,6 +59,8 @@ export {
59
59
  saveMediaToGallery, shareMedia, createSaveHandler, createShareHandler, createMediaHandlers,
60
60
  } from "./infrastructure/utils";
61
61
 
62
+ export { distinctBy } from "./utils/arrayUtils";
63
+
62
64
  export type {
63
65
  IntervalOptions, ProgressOptions, StatusCheckResult, ResultValidation, ValidateResultOptions,
64
66
  PhotoInput, PreparedImage, ImageSelector, VideoSaver, AlertFunction, FeatureUtilsConfig, VideoAlertFunction,
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Deduplicates an array of objects based on a specific key.
3
+ * Keeps the first occurrence of each item with a unique key.
4
+ *
5
+ * @param array The array to deduplicate
6
+ * @param keyFn A function that returns the unique key for each item
7
+ * @returns A new array with duplicate items removed
8
+ */
9
+ export const distinctBy = <T>(array: readonly T[], keyFn: (item: T) => string | number): T[] => {
10
+ const seen = new Set<string | number>();
11
+ const result: T[] = [];
12
+
13
+ for (const item of array) {
14
+ const key = keyFn(item);
15
+ if (!seen.has(key)) {
16
+ seen.add(key);
17
+ result.push(item);
18
+ }
19
+ }
20
+
21
+ return result;
22
+ };