ealush / vest

Vest ✅ Declarative validations framework

Home Page:https://vestjs.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[EASY] Add singular form error selectors

ealush opened this issue · comments

Add singular form of the following:

getErrors() -> getError()
getWarnings() -> getWarning()

The idea is to return the first error/warning of a field, instead of an array.
Unlike getErrors/getWarnings that can either take 0 or 1 arguments, getError/getWarning must receive a field name.

Function signature:

function getError(fieldName: string): string;
function getWarning(fieldName: string): string;

General guidelines:

Add the functions here:
https://github.com/ealush/vest/blob/latest/packages/vest/src/core/suite/produce/produceSuiteResult.ts#L25-L27

Add to the API reference here:
https://github.com/ealush/vest/blob/latest/website/docs/api_reference.md

Add full documentation here:
https://github.com/ealush/vest/blob/latest/website/docs/writing_your_suite/result_object.md

Also, don't forget about tests.

Hi 👋🏼
I'd like to take this task

@shani-arnon are you still working on this?

@jhowlett-scottlogic 👋🏼
Yes, sorry for the late response

@shani-arnon Sorry but i do not have the time to work on it now. I had a period of free time but i am now busy again with other commitments

Hi! Could I work on this?

Added in V5