diff --git a/packages/vest-utils/src/utilityTypes.ts b/packages/vest-utils/src/utilityTypes.ts index f50679dbd..20afd6681 100644 --- a/packages/vest-utils/src/utilityTypes.ts +++ b/packages/vest-utils/src/utilityTypes.ts @@ -12,7 +12,7 @@ export type Nullish = Nullable | Maybe; export type Nullable = T | null; -export type Maybe = T | undefined | void; +export type Maybe = T | undefined; export type OneOrMoreOf = T | T[]; diff --git a/packages/vest/src/suiteResult/selectors/suiteSelectors.ts b/packages/vest/src/suiteResult/selectors/suiteSelectors.ts index 8e6a082a5..63b0e61fe 100644 --- a/packages/vest/src/suiteResult/selectors/suiteSelectors.ts +++ b/packages/vest/src/suiteResult/selectors/suiteSelectors.ts @@ -142,7 +142,7 @@ export function suiteSelectors( function getWarning(): Maybe>; function getWarning(fieldName: F): Maybe; - function getWarning(fieldName?: F): GetSingularResponse { + function getWarning(fieldName?: F): Maybe | string> { return getFailure(Severity.WARNINGS, summary, fieldName as F); } @@ -154,7 +154,7 @@ export function suiteSelectors( function getError(): Maybe>; function getError(fieldName: F): Maybe; - function getError(fieldName?: F): GetSingularResponse { + function getError(fieldName?: F): Maybe | string> { return getFailure(Severity.ERRORS, summary, fieldName as F); } @@ -181,12 +181,12 @@ export function suiteSelectors( } export interface SuiteSelectors { - getWarning(): Maybe>; - getWarning(fieldName: F): Maybe; - getWarning(fieldName?: F): GetSingularResponse; - getError(): Maybe>; - getError(fieldName: F): Maybe; - getError(fieldName?: F): GetSingularResponse; + getWarning(): SummaryFailure | undefined; + getWarning(fieldName: F): string | undefined; + getWarning(fieldName?: F): SummaryFailure | string | undefined; + getError(): SummaryFailure | undefined; + getError(fieldName: F): string | undefined; + getError(fieldName?: F): SummaryFailure | string | undefined; getErrors(): FailureMessages; getErrors(fieldName: F): string[]; getErrors(fieldName?: F): string[] | FailureMessages; @@ -311,7 +311,3 @@ function getFailure( matchingFieldName(summaryFailure, fieldName) )?.message; } - -type GetSingularResponse = Maybe< - string | SummaryFailure ->; diff --git a/yarn.lock b/yarn.lock index 5289e4174..c06fa1a65 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5341,7 +5341,7 @@ __metadata: version: 0.0.0-use.local resolution: "anyone@workspace:packages/anyone" dependencies: - vest-utils: ^1.0.3 + vest-utils: ^1.1.0 languageName: unknown linkType: soft @@ -6618,11 +6618,11 @@ __metadata: languageName: node linkType: hard -"context@^3.0.12, context@workspace:packages/context": +"context@^3.0.13, context@workspace:packages/context": version: 0.0.0-use.local resolution: "context@workspace:packages/context" dependencies: - vest-utils: ^1.0.3 + vest-utils: ^1.1.0 languageName: unknown linkType: soft @@ -11630,14 +11630,14 @@ __metadata: languageName: node linkType: hard -"n4s@^5.0.5, n4s@workspace:packages/n4s": +"n4s@^5.0.6, n4s@workspace:packages/n4s": version: 0.0.0-use.local resolution: "n4s@workspace:packages/n4s" dependencies: "@types/validator": ^13.11.1 - context: ^3.0.12 + context: ^3.0.13 validator: 13.9.0 - vest-utils: ^1.0.3 + vest-utils: ^1.1.0 languageName: unknown linkType: soft @@ -15544,15 +15544,15 @@ __metadata: languageName: node linkType: hard -"vast@^1.0.21, vast@workspace:packages/vast": +"vast@^1.0.22, vast@workspace:packages/vast": version: 0.0.0-use.local resolution: "vast@workspace:packages/vast" dependencies: - vest-utils: ^1.0.3 + vest-utils: ^1.1.0 languageName: unknown linkType: soft -"vest-utils@^1.0.3, vest-utils@workspace:packages/vest-utils": +"vest-utils@^1.1.0, vest-utils@workspace:packages/vest-utils": version: 0.0.0-use.local resolution: "vest-utils@workspace:packages/vest-utils" languageName: unknown @@ -15569,20 +15569,20 @@ __metadata: version: 0.0.0-use.local resolution: "vest@workspace:packages/vest" dependencies: - context: ^3.0.12 - n4s: ^5.0.5 - vast: ^1.0.21 - vest-utils: ^1.0.3 - vestjs-runtime: ^1.0.3 + context: ^3.0.13 + n4s: ^5.0.6 + vast: ^1.0.22 + vest-utils: ^1.1.0 + vestjs-runtime: ^1.0.4 languageName: unknown linkType: soft -"vestjs-runtime@^1.0.3, vestjs-runtime@workspace:packages/vestjs-runtime": +"vestjs-runtime@^1.0.4, vestjs-runtime@workspace:packages/vestjs-runtime": version: 0.0.0-use.local resolution: "vestjs-runtime@workspace:packages/vestjs-runtime" dependencies: - context: ^3.0.12 - vest-utils: ^1.0.3 + context: ^3.0.13 + vest-utils: ^1.1.0 languageName: unknown linkType: soft