tiptap/packages/core/src/utils/minMax.ts

4 lines
141 B
TypeScript
Raw Normal View History

2020-03-28 06:17:28 +08:00
export default function minMax(value: number = 0, min: number = 0, max: number = 0): number {
2019-12-08 07:16:44 +08:00
return Math.min(Math.max(value, min), max)
2020-09-24 06:29:05 +08:00
}