ant-design/components/progress/utils.ts
2019-01-18 15:19:36 +08:00

8 lines
183 B
TypeScript

export function validProgress(progress: number | undefined) {
if (!progress || progress < 0) {
return 0;
} else if (progress > 100) {
return 100;
}
return progress;
};