renovate/lib/util/array.ts
2022-10-07 12:42:01 +02:00

12 lines
246 B
TypeScript

import is from '@sindresorhus/is';
export function coerceArray<T>(input: T[] | null | undefined): T[] {
if (is.array(input)) {
return input;
}
return [];
}
export function sortNumeric(a: number, b: number): number {
return a - b;
}