@canard/schema-form
Version:
React-based component library that renders forms based on JSON Schema with plugin system support for validators and UI components
19 lines (18 loc) • 970 B
TypeScript
import type { ObjectSchema } from '../../../../../../types';
/**
* Intersects two object schema objects, merging their constraints and properties.
*
* This function performs a complete intersection of object-specific schema properties including:
* - Property count constraints (minProperties, maxProperties)
* - Property name constraints (intersects string schemas for propertyNames)
* - Enum and const value intersections (with deep equality)
* - Property schema distribution through allOf
* - Required field unions
* - Validation of constraint consistency
*
* @param base - The base object schema to modify and return
* @param source - The source object 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 intersectObjectSchema: (base: ObjectSchema, source: Partial<ObjectSchema>) => ObjectSchema;