fix(DatetimePicker): error in some edge cases (#10140)

This commit is contained in:
neverland 2022-01-01 10:25:51 +08:00 committed by GitHub
parent 0b12b45d69
commit f63ea390b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,9 +18,13 @@ export const pickerInheritKeys = Object.keys(pickerSharedProps) as Array<
>;
export function times<T>(n: number, iteratee: (index: number) => T) {
let index = -1;
if (n < 0) {
return [];
}
const result: T[] = Array(n);
let index = -1;
while (++index < n) {
result[index] = iteratee(index);
}