Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2c498d2

Browse files
fix(@angular/cli): don't set a default for array options when length is 0
This change prevents the CLI from setting a default value for array options that have a length of zero. Previously, this would result in an empty array being added as a default, which isn't the intended behavior.
1 parent 7e8ae01 commit 2c498d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎packages/angular/cli/src/command-builder/utilities/json-schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export async function parseJsonSchemaToOptions(
206206
}
207207
break;
208208
case 'array':
209-
if (Array.isArray(current.default)) {
209+
if (Array.isArray(current.default)&&current.default.length>0) {
210210
defaultValue = current.default;
211211
}
212212
break;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /