Skip to content

Commit

Permalink
fix(cdk/coercion): add the support for readonly array coercion
Browse files Browse the repository at this point in the history
Fixes a type definition of coerceArray so that it accepts both mutable and
immutable arrays.

Fixes #18806
  • Loading branch information
klemenoslaj committed Mar 12, 2020
1 parent 807498d commit cae94df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cdk/coercion/array.ts
Expand Up @@ -7,6 +7,6 @@
*/

/** Wraps the provided value in an array, unless the provided value is an array. */
export function coerceArray<T>(value: T | T[]): T[] {
export function coerceArray<T>(value: T | readonly T[]): T[] {
return Array.isArray(value) ? value : [value];
}

0 comments on commit cae94df

Please sign in to comment.