Skip to content

Commit

Permalink
🐛 fix array init value
Browse files Browse the repository at this point in the history
  • Loading branch information
stsysd committed May 28, 2024
1 parent 3db8310 commit df6ddd6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ export function parse<T extends object>(
function initWithMetadata(ctx: ParseContext) {
for (const opt of ctx.optMap.values()) {
if (opt.multiple) {
ctx.instance[opt.prop] = [];
ctx.instance[opt.prop] ??= [];
}
}

Expand Down

0 comments on commit df6ddd6

Please sign in to comment.