@embeddable.com/sdk-react 2.2.13 → 2.2.14

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/index.esm.js CHANGED
@@ -444,6 +444,16 @@ const componentMetaSchema = z
444
444
  })
445
445
  .strict()
446
446
  .array()
447
+ .superRefine((inputs, refinementContext) => {
448
+ const inputNames = inputs.map((input) => input.name);
449
+ if (new Set(inputNames).size !== inputNames.length) {
450
+ const duplicateInputNames = inputNames.filter((name, index) => inputNames.indexOf(name) !== index);
451
+ return refinementContext.addIssue({
452
+ code: z.ZodIssueCode.custom,
453
+ message: `Input names must be unique. Duplicate names: ${duplicateInputNames.join(", ")}`,
454
+ });
455
+ }
456
+ })
447
457
  .optional(),
448
458
  events: z
449
459
  .object({