(
instancePath: string,
schema: JsonSchema,
matchPath: (path: string) => boolean
)
| 13 | |
| 14 | const getErrorsAt = |
| 15 | ( |
| 16 | instancePath: string, |
| 17 | schema: JsonSchema, |
| 18 | matchPath: (path: string) => boolean |
| 19 | ) => |
| 20 | (state: JsonFormsCore): ErrorObject[] => { |
| 21 | const errors = state.errors ?? []; |
| 22 | const additionalErrors = state.additionalErrors ?? []; |
| 23 | return errorsAt( |
| 24 | instancePath, |
| 25 | schema, |
| 26 | matchPath |
| 27 | )( |
| 28 | state.validationMode === 'ValidateAndHide' |
| 29 | ? additionalErrors |
| 30 | : [...errors, ...additionalErrors] |
| 31 | ); |
| 32 | }; |
| 33 | |
| 34 | export const errorAt = (instancePath: string, schema: JsonSchema) => |
| 35 | getErrorsAt(instancePath, schema, (path) => path === instancePath); |
no test coverage detected
searching dependent graphs…