Files
SnowLuma/.pnpm-store/v11/files/85/539bd3ca1fba98e69910a344be88d2a27e359e80745d510e0fb4b704f2c447d6d243ecf245db366a879ea8cd6965b869fc99a3a45a3c702148a218644b2632
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

17 lines
499 B
Plaintext

import { clamp } from '../clamp.mjs';
function steps(numSteps, direction = "end") {
return (progress) => {
progress =
direction === "end"
? Math.min(progress, 0.999)
: Math.max(progress, 0.001);
const expanded = progress * numSteps;
const rounded = direction === "end" ? Math.floor(expanded) : Math.ceil(expanded);
return clamp(0, 1, rounded / numSteps);
};
}
export { steps };
//# sourceMappingURL=steps.mjs.map