提交 c91fc7f2 编写于 作者: M Matt Bierner

Use ReadonlyArray for coalesce

coalesce does not mutate its input array
上级 755a69e9
......@@ -295,7 +295,7 @@ function topStep<T>(array: ReadonlyArray<T>, compare: (a: T, b: T) => number, re
/**
* @returns a new array with all falsy values removed. The original array IS NOT modified.
*/
export function coalesce<T>(array: Array<T | undefined | null>): T[] {
export function coalesce<T>(array: ReadonlyArray<T | undefined | null>): T[] {
if (!array) {
return array;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册