Skip to content

Commit 6204dbc

Browse files
committed
Validate defaultValue type
1 parent 3061744 commit 6204dbc

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

v-next/core/src/config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export function overrideTask(
6161
export function globalParameter<T extends ParameterType>(options: {
6262
name: string;
6363
description: string;
64-
parameterType: ParameterType;
64+
parameterType?: T;
6565
defaultValue: ParameterTypeToValueType<T>;
6666
}): GlobalParameter {
6767
return buildGlobalParameterDefinition(options);

v-next/core/src/internal/global-parameters.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,15 @@ export function buildGlobalParameterMap(
5151
return globalParametersIndex;
5252
}
5353

54-
export function buildGlobalParameterDefinition<
55-
T extends ParameterType,
56-
>(options: {
54+
export function buildGlobalParameterDefinition<T extends ParameterType>({
55+
name,
56+
description,
57+
parameterType,
58+
defaultValue,
59+
}: {
5760
name: string;
5861
description: string;
59-
parameterType: ParameterType;
62+
parameterType?: T;
6063
defaultValue: ParameterTypeToValueType<T>;
6164
}): GlobalParameter {
6265
// TODO: Validate name casing

0 commit comments

Comments
 (0)