chore: Fix the required

This commit is contained in:
BluJ
2023-05-03 13:42:20 -06:00
parent c683147c71
commit 0ee97f610d
2 changed files with 3 additions and 2 deletions

View File

@@ -640,7 +640,7 @@ export class Value<Type, WD> {
}, },
aVariants: Variants<Type, WrapperData> | Variants<Type, never>, aVariants: Variants<Type, WrapperData> | Variants<Type, never>,
) => { ) => {
return new Value<Type | null | undefined, WrapperData>( return new Value<AsRequired<Type, Required>, WrapperData>(
async (options) => ({ async (options) => ({
type: "union" as const, type: "union" as const,
description: null, description: null,
@@ -651,7 +651,7 @@ export class Value<Type, WD> {
disabled: (await getDisabledFn(options)) || [], disabled: (await getDisabledFn(options)) || [],
immutable: false, immutable: false,
}), }),
aVariants.validator.optional(), asRequiredParser(aVariants.validator, a),
) )
} }
} }

View File

@@ -59,3 +59,4 @@ export const smtpConfig = Value.filteredUnion(async ({ effects, utils }) => {
}, },
}), }),
) )
type test = typeof smtpConfig.validator._TYPE