aquavox/src/lib/truncate.ts
alikia2x bb27df5c8d fix: prevent negative transform in lyrics update.
ref: let the code in lyrics more structured
add: global truncate function
improve: small improvements in routes/play/[id]
2024-07-25 19:03:09 +08:00

3 lines
122 B
TypeScript

export default function truncate(value: number, min: number, max: number) {
return Math.min(Math.max(value, min), max);
}