@rjsf/utils
Version:
Utility functions for @rjsf/core
9 lines (8 loc) • 486 B
TypeScript
import { ErrorSchema, RJSFValidationError } from './types.js';
/** Converts an `errorSchema` into a list of `RJSFValidationErrors`
*
* @param errorSchema - The `ErrorSchema` instance to convert
* @param [fieldPath=[]] - The current field path, defaults to [] if not specified
* @returns - The list of `RJSFValidationErrors` extracted from the `errorSchema`
*/
export default function toErrorList<T = any>(errorSchema?: ErrorSchema<T>, fieldPath?: string[]): RJSFValidationError[];