UNPKG

@sphereon/ssi-sdk.data-store

Version:

11 lines (9 loc) 365 B
import { ValidationError } from 'class-validator' import { type ValidationConstraint } from '../types' export const getConstraint = (validation: ValidationError): ValidationConstraint | undefined => { if (validation.children && validation.children.length > 0) { return getConstraint(validation.children[0]) } else { return validation.constraints } }