Skip to content

Commit

Permalink
fix: fixed array type for default values (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
NasgulNexus committed Aug 8, 2023
1 parent 51a2012 commit e7435e5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib/kit/utils/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
NumberSpec,
ObjectValue,
Spec,
SpecTypes,
StringSpec,
isArraySpec,
isObjectSpec,
Expand Down Expand Up @@ -76,7 +77,10 @@ export const prepareSpec = <Type extends Spec>(
}
}

if (typeof _defaultValue === result.type) {
if (
typeof _defaultValue === result.type ||
(_.isArray(_defaultValue) && result.type === SpecTypes.Array)
) {
result.defaultValue = _defaultValue;
} else {
result.defaultValue = undefined;
Expand Down

0 comments on commit e7435e5

Please sign in to comment.