diff --git a/src/utils/common.ts b/src/utils/common.ts index 62252d250ec..83e99be378b 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -612,6 +612,10 @@ export function getShinyDescriptor(variant: Variant): string { } } +/** + * If the input isn't already an array, turns it into one. + * @returns An array with the same type as the type of the input + */ export function coerceArray(input: T | T[]): T[] { return Array.isArray(input) ? input : [input]; }