@ng-formworks/core
Version:
Angular ng-formworks - JSON Schema Form builder core
20 lines (19 loc) • 640 B
TypeScript
/**
* 'mergeSchemas' function
*
* Merges multiple JSON schemas into a single schema with combined rules.
*
* If able to logically merge properties from all schemas,
* returns a single schema object containing all merged properties.
*
* Example: ({ a: b, max: 1 }, { c: d, max: 2 }) => { a: b, c: d, max: 1 }
*
* If unable to logically merge, returns an allOf schema object containing
* an array of the original schemas;
*
* Example: ({ a: b }, { a: d }) => { allOf: [ { a: b }, { a: d } ] }
*
* // schemas - one or more input schemas
* // - merged schema
*/
export declare function mergeSchemas(...schemas: any[]): any;