ant-design/components/progress/utils.ts
2019-08-14 18:21:24 +08:00

11 lines
237 B
TypeScript

// eslint-disable-next-line import/prefer-default-export
export function validProgress(progress: number | undefined) {
if (!progress || progress < 0) {
return 0;
}
if (progress > 100) {
return 100;
}
return progress;
}