stepTimingFunction = (step = 1, direction = "end") => {
  var stepDist = 1 / step;

  return function (rate) {
    let pos = 0;

    const offset = round(rate / stepDist, 10000000);
    if (direction == "start") {
      pos = Math.ceil(offset);
    } else if (direction == "end") {
      if (rate === 0) return 0;
      else if (rate === 1) return 1;

      pos = Math.ceil(offset) - 1;
    }

    return Math.min(Math.max(stepDist * pos, 0), 1);
  };
}
step timing function

@param {number} step
@param {string} direction
@param {number} roundNumber
@returns