(error: ErrorObject)
| 40 | * @returns The invalid property name if present, otherwise undefined |
| 41 | */ |
| 42 | const getInvalidProperty = (error: ErrorObject): string | undefined => { |
| 43 | switch (error.keyword) { |
| 44 | case 'required': |
| 45 | case 'dependencies': |
| 46 | return error.params.missingProperty; |
| 47 | case 'additionalProperties': |
| 48 | return error.params.additionalProperty; |
| 49 | default: |
| 50 | return undefined; |
| 51 | } |
| 52 | }; |
| 53 | |
| 54 | export const getControlPath = (error: ErrorObject) => { |
| 55 | // Up until AJV v7 the path property was called 'dataPath' |
no outgoing calls
no test coverage detected
searching dependent graphs…