@canard/schema-form
Version:
React-based component library that renders forms based on JSON Schema with plugin system support for validators and UI components
17 lines (16 loc) • 792 B
TypeScript
import type { NullSchema } from '../../../../../../types';
/**
* Intersects two null schema objects, merging their constraints and properties.
*
* This function handles the intersection of null-specific schema properties including:
* - Enum value intersections (null values)
* - Const value intersections
* - Required field unions
* - Metadata field handling (first-win and overwrite strategies)
*
* @param base - The base null schema to modify and return
* @param source - The source null schema to intersect with base
* @returns The modified base schema with intersected properties
* @throws {JsonSchemaError} When enum intersections are empty or const values conflict
*/
export declare const intersectNullSchema: (base: NullSchema, source: Partial<NullSchema>) => NullSchema;