UNPKG

@canard/schema-form

Version:

React-based component library that renders forms based on JSON Schema with plugin system support for validators and UI components

20 lines (19 loc) 972 B
import type { ArraySchema } from '../../../../../../types'; /** * Intersects two array schema objects, merging their constraints and properties. * * This function performs a complete intersection of array-specific schema properties including: * - Item count constraints (minItems, maxItems) * - Contains constraints (minContains, maxContains) * - Unique items requirement (boolean OR operation) * - Enum and const value intersections (with deep equality) * - Item schema distribution through allOf * - Required field unions * - Validation of constraint consistency * * @param base - The base array schema to modify and return * @param source - The source array schema to intersect with base * @returns The modified base schema with intersected properties * @throws {JsonSchemaError} When constraints create invalid ranges or conflicting values */ export declare const intersectArraySchema: (base: ArraySchema, source: Partial<ArraySchema>) => ArraySchema;