Making sure an outline suits a preexisting sorts of

Making sure an outline suits a preexisting sorts of

Customizing problems

On the easiest case a test form productivity genuine otherwise untrue with regards to the whether the consider enacted. When it comes to a deep failing take to, yup will put an effective ValidationError with your (or even the standard) content for that try. ValidationErrors along with include a lot of almost every other metadata regarding test, along with it’s identity, exactly what arguments (if any) it was titled which have, and the path to the newest weak field in the example of an effective nested recognition.

const acquisition = object( no: number().called for(). sku: sequence().test( name: 'is-sku', skipAbsent: true, test(well worth, ctx)  if (!value.startsWith('s-'))  return ctx.createError( message: 'SKU lost best prefix' >) > if (!value.endsWith('-42a'))  return ctx.createError( message: 'SKU missing best suffix' >) > if (value.duration  ten)  return ctx.createError( message: 'SKU is not the correct length' >) > return true > >) >) order.Continue reading